Start GUI

class caltrig.start_gui.MainWindow(*args, **kwargs)[source]

Bases: QMainWindow

Main window of the application. It displays a window with a menu bar and a central widget, that contains the visualization of imported data and the tools to interact with it.

activate_params(viewer)[source]

Activates the parameters of the selected viewer and deactivates the parameters of the previous viewer.

Parameters:

viewer (Viewer) – The viewer that was selected.

closeEvent(event)[source]

Calls the parent closeEvent and closes all other windows.

Parameters:

event (QCloseEvent) – The event that is triggered when the window is closed.

delete_selection()[source]

Deletes the current selection from the application. Readjusts the visualization and removes all references to the selection.

generate_ini_file()[source]

Opens a dialog to generate an INI file for the current selection.

load_clustering(result)[source]

Loads the clustering results into the current instance.

Parameters:

result (dict) – A dictionary containing the clustering results.

load_clustering_params()[source]

Loads the clustering parameters from a dialog and starts the clustering process.

load_data(_)[source]

Loads data from a folder and creates a DataInstance object for each file in the folder.

load_instance(fname)[source]

Loads an instance of the DataInstance class and adds it to the instances dictionary.

Parameters:

fname (str) – The path to the ini file that contains the data

load_saved_state()[source]

Loads a previously saved state of the application from a JSON file. The file contains the paths of the loaded data and the default parameters for the events.

save()[source]

Saves the current state of the application to a JSON file. The file contains the paths of the loaded data and the default parameters for the events.

start_caltrig(current_selection=None)[source]

Starts the Caltrig window for the current selection. If a selection is not provided, the current selection of the GUI will be used.

Parameters:

current_selection (Viewer, optional) – The current selection to be analyzed. If not provided, the current selection of the GUI will be used.

start_ga(ga)[source]

Starts the Genetic Algorithm window and the Generation Score window for the provided Genetic Algorithm object.

Parameters:

ga (GeneticAlgorithm) – The Genetic Algorithm object to be visualized.

start_inspection(current_selection=None)[source]

Initialize the clustering inspection window for the current selection. If a selection is not provided, the current GUI selection will be used.

Parameters:

current_selection (Viewer, optional) – The current selection to be inspected. If not provided, the current selection of the GUI will be used.

update_cluster(result)[source]

Updates the clustering results of the current selection.

Parameters:

result (dict) – A dictionary containing the clustering results.

update_defaults()[source]

Opens a dialog to update the default parameters of the events.

update_params()[source]

Updates the parameters of the current selection in the GUI.

caltrig.start_gui.start_gui(processes=True)[source]

Function to initiate the PyQt5 GUI.

Example

>>> from caltrig.start_gui import start_gui
>>> if __name__ == "__main__":
>>>     start_gui()