mad_gui.components.dialogs.plugin_selection.LoadDataDialog#

class mad_gui.components.dialogs.plugin_selection.LoadDataDialog(base_dir: Path, loaders: List[Type[BaseImporter]], parent=None, initial_state: LoadDataDialogState | None = None)[source]#

A dialog, opened upon pressing Load data button in the GUI - interface to use importers.

When the user wants to load data, they use this dialog. In the dialog, the user can use a dropdown menu to select an importer they want to use. This importer must previously have been passed to the GUI via the mad_gui.start_gui(). The importer can be created as described in 1   Importer.

Parameters:
base_dir

A base directory, which should be shown when the use wants to select a file - you can configure this by passing a data_dir to mad_gui.start_gui().

loaders

All the importers that were passed to mad_gui.start_gui(), which will be shown in the dropdown.

parent

It is used to set the window and button style

initial_state

Will be assigned to self.state, which keeps the data of this view.

Methods

get_data()

Run this dialog and return the data, that was selected by the user.

validate_data_format

Check whether the importer returned data in the expected formats and throw messages on what went wrong, if so.

__init__(base_dir: Path, loaders: List[Type[BaseImporter]], parent=None, initial_state: LoadDataDialogState | None = None)[source]#
get_data() Tuple[Dict[str, Dict[str, Any]], BaseImporter] | None[source]#

Run this dialog and return the data, that was selected by the user.