helper module
Define functions to be as DRY as possible.
- setup_dropdown(module_name, base_class, buttons_args)
Set up interface with a dropdown menu and a button next to it.
- Parameters:
module_name (
str) – Where the entries of the dropdown will be searched.base_class (
ABCMeta) – The base class from which dropdown entries should inherit.buttons_args (
dict[str,Any]) – Dictionary where the keys are the name of the buttons to add next to the dropdown menu, and values the callable that will be called when clicking the button. Several callables can be provided as a list or tuple.
- Return type:
tuple[dict[str,str],QHBoxLayout,QComboBox,list[QPushButton]]- Returns:
dict[str, str] – Keys are the name of the objects inheriting from
base_classfound inmodule_name. Values are the path leading to them.QHBoxLayout – Layout holding together
dropdownandbutton.QComboBox – Dropdown menu holding the keys of
classes.list[QPushButton] – The buttons next to the dropdown menu.
- set_dropdown_value(dropdown, value)
Set a
dropdownto desired value.- Parameters:
- Return type:
- setup_linspace_entries(label, initial_values, max_value=None)
Create an input to call np.linspace.
- Return type:
- _linspace_entry(is_int, x_0, x_min=0, x_max=None)
Create widget for a single linspace entry.
- Return type:
- to_plot_checkboxes(label, boxes_labels, *, several_can_be_checked=False)
Create several check boxes next to each other.
- Return type:
- PARAMETER_POS_TO_ATTR = {0: 'name', 1: 'unit', 2: 'value', 3: 'lower_bound', 4: 'upper_bound', 5: 'lock', 6: 'description'}
Maps column position in list of parameters to the corresponding Parameter attribute