gui module

Define a GUI.

Todo

Export/Import settings

Todo

Add description at and of parameters Dynamic boxes for Parameters?

class MainWindow(default_model='Vaughan', default_loader='PandasLoader', default_plotter='PandasPlotter')

Bases: QMainWindow

This object holds the GUI.

Create the GUI.

autofill_data_to_plot = True

If selecting Model in dropdown should automatically fill the appopriate data to plot checkbox

autofill_nature_to_plot = True

If selecting Model in dropdown should automatically fill the appopriate emission data checkbox

autofill_plotting_ranges = True

If loading data should automatically fill the energy/angle ranges with their maximum values

_setup_file_selection_matrix()

Create the 4 * 3 matrix to select the files to load.

Return type:

list[list[None | QListWidget]]

_deactivate_unnecessary_file_widgets()

Grey out the files not needed by current model.

Return type:

None

_setup_loader_dropdown()

Set the Loader related interface.

Return type:

None

_setup_loader()

Setup new loader whenever the dropdown menu is changed.

Return type:

None

_setup_loader_settings_dialog()

Give arguments to setup the loader setttings button.

Return type:

tuple[str, Callable]

load_data()

Load all the files set in GUI.

Return type:

None

_setup_model_dropdown()

Set the Model related interface.

Assign the model_classes and model_dropdown.

Return type:

None

_setup_model_settings_dialog()

Give arguments to setup the model setttings button.

Return type:

tuple[str, Callable]

_setup_model_configuration()

Set the interface related to the model specific parameters.

Return type:

QTableWidget

_setup_model()

Instantiate Model when it is selected in dropdown menu.

Return type:

None

_populate_parameters_table_constants()

Print out the model parameters in dedicated table.

Return type:

None

_update_parameter_value_from_table(item)

Update Parameter value based on user input in table.

Return type:

None

fit_model()

Perform the fit on the loaded data.

Return type:

None

_populate_parameters_table_values()

Print out the values of the model parameters in dedicated table.

Return type:

None

_setup_model_evaluation()

Setup display of model evaluators.

Return type:

None

_create_evaluators_table()

Create the two-column table that displays evaluation results.

Return type:

QTableWidget

_set_reevaluation_button()

Create and return the ‘Re-evaluate’ button.

Return type:

QPushButton

_fill_evaluations_display()

Fill the evaluations display with the last model.

Return type:

None

_evaluate_model()

Evaluate model and save resulting dict in self.evaluations.

Return type:

None

_populate_evaluators_table()

Write the contents of self.evaluations into the table.

Return type:

None

_fill_plot_nature_and_population()

Check emission data type and population.

When model is updated, check the Data to plot and Population to plot checkboxes in the Plot tab that are concerned by current model.

Return type:

None

_setup_energy_angle_inputs()

Set the energy and angle inputs for the model plot.

Return type:

None

_setup_plotter_dropdowns()

Set the Plotter related interface.

Return type:

None

_set_up_data_to_plot_checkboxes()

Add checkbox to select which data should be plotted.

Return type:

None

_set_up_population_to_plot_checkboxes()

Add checkbox to select which population should be plotted.

Return type:

None

plot_measured()

Plot the desired data, as imported.

Return type:

None

plot_model()

Plot the desired data, as modelled.

Return type:

None

_get_emission_data_type_to_plot()

Read input to determine the emission data type to plot.

Return type:

tuple[bool, Literal['Emission Yield', 'Emission Energy', 'Emission Angle'] | None]

_get_populations_to_plot()

Read input to determine the populations to plot.

Return type:

tuple[bool, list[Literal['SE', 'EBE', 'IBE', 'all']]]

_gen_linspace(variable)

Take the desired input, check validity, create array of values.

Return type:

tuple[bool, ndarray]

_fill_plotting_ranges()

Fill energy and angle plotting ranges to match data files values.

This method is called when the button Load is pressed.

Return type:

None

_dropdown_to_class(name)

Convert dropdown entry to class.

Return type:

ABCMeta

_set_list_widget_state(widget, enabled)

Enable or disable a QListWidget based on enabled.

Return type:

None

_set_default_dropdown()

Set dropdowns to their default values.

We call this method at the end of the GUI initialization rather than at the creation of the dropdowns to ensure that every side effects is executed.

Return type:

None

main()