GUI

Graphic interface to launch analyses

Main Window

Filter/group sessions

Display metadata

Analysises list

class cicada.gui.cicada_analysis_tree_gui.AnalysisTreeApp(parent, config_handler, analyses_instances, to_parameters_button=None)[source]
create_tree_model()[source]

Create the tree model Returns: the tree model, an instance of QAnalysisTreeModel

doubleClickedItem(idx)[source]

Method called when the user double click in the tree :param idx: Index of the branch clicked

Returns:

init_ui()[source]

Set some of the elements used to build the tree Returns:

invalidate_all_items()[source]

invalidate all items if the tree Returns:

load_arguments_parameters_section()[source]

Used to load the parameters section with widgets, based on the current selection in the tree. If the selection is not on any valid tree item, nothing will happen Returns: None

set_data(data_to_analyse, data_format)[source]

Give to the tree the data that the analysis classes will be given to analyze. Allows the tree to inactivate the analyses for which the data don’t fulfill the requierements :param data_to_analyse: a list of data in a given format (could be nwb or other) :param data_format: format of the data, must be a string. So far only “nwb” is supported

Returns: None

class cicada.gui.cicada_analysis_tree_gui.QAnalysisTreeModel(tree_item, parent=None)[source]
columnCount(self, parent: QModelIndex = QModelIndex()) int[source]
data(index, role)[source]
Parameters
  • index

  • role

Returns

flags(self, index: QModelIndex) Qt.ItemFlags[source]
headerData(self, section: int, orientation: Qt.Orientation, role: int = Qt.ItemDataRole.DisplayRole) Any[source]
index(self, row: int, column: int, parent: QModelIndex = QModelIndex()) QModelIndex[source]
parent(self, child: QModelIndex) QModelIndex[source]
parent(self) QObject
rowCount(self, parent: QModelIndex = QModelIndex()) int[source]
class cicada.gui.cicada_analysis_tree_gui.QAnalysisTreeView(tree_item, config_handler, parent=None)[source]
drawBranches(self, painter: QPainter, rect: QRect, index: QModelIndex)[source]
isIndexHidden(q_model_index)[source]

Avoid to select the line that display the family name :param q_model_index: :return:

keyPressEvent(event)[source]
Parameters

event – P -> set background picture

Returns:

cicada.gui.cicada_analysis_tree_gui.fill_tree_item_with_dict(root_tree, instances_dict)[source]

Recursive function that fills the root_tree according to data in instances_dict. :param root_tree: instance of TreeItem :param instances_dict: Contains instance of cicada_analysis, in a hierarchy similar to the one we want the tree to be :return:

Overview of analysises

class cicada.gui.cicada_analysis_overview.AnalysisOverview(config_handler, parent=None)[source]

Class containing the overview linked to an analysis

add_analysis_overview(cicada_analysis, analysis_id, obj)[source]

Add widgets to track the corresponding analysis :param cicada_analysis: CicadaAnalysis instance :type cicada_analysis: CicadaAnalysis :param analysis_id: Randomly generated ID linked to the analysis :type analysis_id: str :param obj: The analysis window’s object itself :type obj: object

keyPressEvent(self, a0: QKeyEvent)[source]
class cicada.gui.cicada_analysis_overview.AnalysisState(analysis_id, cicada_analysis, parent=None, without_bringing_to_front=False)[source]

Class containing the name of the analysis and the subjects analysed

bring_to_front(window_id, event)[source]

Bring corresponding analysis window to the front (re-routed from the double click method)

Parameters
  • window_id (QWidget) – Analysis Widget object

  • event (QEvent) – Double click event

deleteLater()[source]

Re-implementation of the deleteLater method to properly delete the whole widget

class cicada.gui.cicada_analysis_overview.ResultsButton(cicada_analysis)[source]

Class containing the button to open the result folder

deleteLater()[source]

Re-implementation of the deleteLater method to properly delete the widget

open_explorer()[source]

Open the file explorer depending on the OS

Analysis parameters

class cicada.gui.cicada_analysis_parameters_gui.AnalysisData(cicada_analysis, arguments_section_widget, config_handler, parent=None)[source]
keyPressEvent(event)[source]
Parameters

event – P -> set background picture

Returns:

populate_session_list(session_list)[source]

Add all session to the QListWidget :param session_list: List of all sessions’ identifier :type session_list: list

class cicada.gui.cicada_analysis_parameters_gui.AnalysisPackage(cicada_analysis, analysis_name, name, main_window, config_handler, parent=None)[source]

Widget containing the whole analysis window

bring_to_front(window_id, event)[source]

Bring corresponding window to the front (re-routed from the double click method)

Parameters
  • window_id (QWidget) – Analysis Widget object

  • event (QEvent) – Double click event

errOutputWritten(text, path)[source]

Append std.err text to the QLabel and create an err file.

Parameters
  • text (str) – Output of the standard output in python interpreter

  • path (str) – path where we will output the err file

normalOutputWritten(text, path)[source]

Append std.out text to the QLabel and create a log file.

Parameters
  • text (str) – Output of the standard output in python interpreter

  • path (str) – path where we will output the log file

on_close(event)[source]

Check if an analysis is still on going and prompt the user to let him know then ask whether he still wants to close. If yes, delete the associated overview and stop the thread

Parameters

event (QEvent) – Qt Event triggered when attempting to close the window

class cicada.gui.cicada_analysis_parameters_gui.AnalysisParametersApp(thread_name, progress_bar, analysis_name, config_handler, parent=None)[source]

Class containing the parameters widgets

create_widgets(cicada_analysis)[source]
Parameters

cicada_analysis (CicadaAnalysis) – Chosen analysis

keyPressEvent(event)[source]
Parameters

event – P -> set background picture

Returns:

load_arguments()[source]

Will open a FileDialog to select a yaml file used to load arguments used for a previous analysis

reset_arguments()[source]

Reset all arguments to default value

run_analysis()[source]

Check if the parameters are valid and then create a thread which will run the analysis

save_yaml_with_name()[source]

Save parameters as a YAML file under the name given by the user. The path is retrieved from the config file and if it doesn’t exist a QFileDialog will be displayed to select the path

tabula_rasa()[source]

Erase the widgets and make an empty section

class cicada.gui.cicada_analysis_parameters_gui.CheckBoxWidget(analysis_arg, parent=None)[source]

Used to set a boolean value

get_value()[source]

Return the value of the widget Returns:

set_value(value)[source]

Set the widget value to the value passed Returns:

to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

class cicada.gui.cicada_analysis_parameters_gui.ColorDialogWidget(analysis_arg, show_alpha_channel, parent=None)[source]

Widget used to select a color

get_value()[source]

Returns: a tuple of 4 floats representing RGBA with values from 0.0 to 1.0

open_dialog()[source]

Open the color dialog Returns:

set_value(value)[source]
Parameters

value – a list or tuple of 3 or 4 float between 0.0 to 1.0, RGB or RGBA values, the A representing the alpha

Returns:

to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

update_button_color()[source]

Returns:

class cicada.gui.cicada_analysis_parameters_gui.ComboBoxWidget(analysis_arg, parent=None)[source]
add_multiple_combo_boxes(session_id, choices_dict, legends, index)[source]

Allows to add multiple combo boxes, each changing the content of the next one for on given session_id :param session_id: :param choices_dict: each key represent a content to put in the list and the value could be either None, either :param another dict which keys will be the content of the next ComboBox etc… or instead of a dict as value it: :param could be a list that will define the content.: :param legends: :param index:

Returns:

get_value()[source]

Returns:

set_value(value)[source]

Set a new value. Either value is None and nothing will happen If value is a list instance, :param value:

Returns:

to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

class cicada.gui.cicada_analysis_parameters_gui.EmittingErrStream(parent=None)[source]

Class managing the std.err redirection

write(text)[source]

Override of the write function used to display output :param text: Python output from stdout :type text: str

class cicada.gui.cicada_analysis_parameters_gui.EmittingStream(parent=None)[source]

Class managing the std.out redirection

write(text)[source]

Override of the write function used to display output :param text: Python output from stdout :type text: str

class cicada.gui.cicada_analysis_parameters_gui.FileDialogWidget(analysis_arg, directory_only, extensions=None, parent=None)[source]

Create a widget that will contain a button to open a FileDialog and a label to display the file or directory choosen A label will also explain what this parameter do

get_value()[source]

Return the argument

Returns

Dictionary with the set value

Return type

result_dict (dict)

one_for_all()[source]

Allows to select the same dir of files for all session Returns:

set_value(value)[source]

Set the value :param value: either None, either a string or etiher a dictionary

Returns:

to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

class cicada.gui.cicada_analysis_parameters_gui.FinalMeta(name, bases, namespace, **kwargs)[source]
class cicada.gui.cicada_analysis_parameters_gui.FloatLineEditWidget(analysis_arg, parent=None)[source]
get_value()[source]

Return the value of the widget Returns:

set_value(value)[source]

Set the widget value to the value passed Returns:

to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

class cicada.gui.cicada_analysis_parameters_gui.GroupElements(group_widget, group_name, group_elements, grid_layout, with_color=False, default_color=None)[source]

Used by GroupsFromCheckboxesWidget to display groups content with the possibility to remove one

get_color()[source]

Returns: a tuple of 4 floats representing RGBA with values from 0.0 to 1.0, or None if no color is define

open_color_dialog()[source]

Open the color dialog Returns:

remove_widgets()[source]

Remove widgets. implementation of the deleteLater method to properly delete the whole widget Will be called by self.ti_manager.delete_interval_name method Returns:

update_button_color()[source]

Returns:

class cicada.gui.cicada_analysis_parameters_gui.GroupsFromCheckboxesWidget(analysis_arg, choices_attr_name, with_color=False, add_custom_group_field=False, custom_group_validation_fct=None, custom_group_processor_fct=None, parent=None)[source]

Display multiple choice that can be selected individually or as group to create new instances. There is also a text field to select all items based on their content (string). Option for a text field allowing to name elements that composed the group, without being in the list

get_value()[source]

Returns: a dict with key is a string representing the group and value is a list with first a list with the elements of the group (strings), and second a color (a tuple of 4 floats representing RGBA with values from 0.0 to 1.0, or None if no color is define)

search_action()[source]

Call when the search button is clicked Returns:

set_value(value)[source]

Set the value. :param value: value is a dict with key is a string representing the group and value is a list with first a list

with the elements of the group (strings), and second a color (a tuple of 4 floats representing RGBA with values from 0.0 to 1.0, or None if no color is define) Returns: None

to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

class cicada.gui.cicada_analysis_parameters_gui.LineEditWidget(analysis_arg, parent=None)[source]
get_value()[source]

Return the value of the widget Returns:

set_value(value)[source]

Set the widget value to the value passed Returns:

to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

class cicada.gui.cicada_analysis_parameters_gui.ListCheckboxWidget(analysis_arg, choices_attr_name, parent=None)[source]

Allows multiple choices

get_value()[source]

Returns:

select_all(session_id)[source]

select all items :param session_id: None or session of which select items :return:

set_value(value)[source]

Set the value. :param value: value is either a string or integer or float, or a list. If a list, then item whose value matches :param one of the elements in the list will be checkeds:

Returns: None

to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

unselect_all(session_id)[source]

Unselect all items :return:

class cicada.gui.cicada_analysis_parameters_gui.MyFileDialogQButton(key_name, file_dialog, file_dialogs_dict, parent=None)[source]

Special button for opening file dialog

open_dialog()[source]

Open the QFileDialog :param key_name:

Returns:

class cicada.gui.cicada_analysis_parameters_gui.MyQComboBox[source]

Special instance of ComboBox allowing to handle change so that it is connected to other combo_boxes

selection_change(index)[source]

Called if the selection is changed either by the user or by the code :param index:

Returns:

class cicada.gui.cicada_analysis_parameters_gui.MyQFrame(analysis_arg=None, parent=None, with_description=True)[source]
change_mandatory_property(value)[source]

Changing the property allowing to change the style sheet depending on the mandatory aspect of the argument :param value:

Returns:

set_property_to_missing()[source]

Allows the change the stylesheet and indicate the user that a Returns:

class cicada.gui.cicada_analysis_parameters_gui.MySelectButton(parent, title, tooltip_text, select_all=False, session_id=None)[source]
class cicada.gui.cicada_analysis_parameters_gui.ParameterWidgetModel[source]
abstract get_value()[source]

Return the value of the widget Returns:

abstract set_value(value)[source]

Set the widget value to the value passed Returns:

abstract to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

class cicada.gui.cicada_analysis_parameters_gui.ProgressBar(remaining_time_label, parent=None)[source]

Class containing the progress bar of the current analysis

update_progress_bar(time_elapsed, increment_value=0, new_set_value=0)[source]

Update the progress bar in the analysis widget and the corresponding remaining time :param time_elapsed: Time elepased since beginning of analysis, in seconds :type time_elapsed: float :param increment_value: Value that should be added to the current value of the progress bar :type increment_value: float :param new_set_value: Value that should be set as the current value of the progress bar :type new_set_value: float

Returns:

update_progress_bar_overview(name, increment_value=0, new_set_value=0)[source]

Update the overview progress bar

Parameters
  • name (str) – Analysis ID

  • time_started (float) – Start time of the analysis

  • increment_value (float) – Value that should be added to the current value of the progress bar

  • new_set_value (float) – Value that should be set as the current value of the progress bar

class cicada.gui.cicada_analysis_parameters_gui.RemainingTime(parent=None)[source]

Class containing the remaining time of the analysis

static correct_time_converter(time_to_convert)[source]

Convert a float in a correct duration value :param time_to_convert: Float value representing seconds to be converted in a correct duration with MM.SS :type time_to_convert: float

Returns

String of the correct duration

Return type

time_text (str)

update_remaining_time(progress_value, time_elapsed, done=False)[source]

Update the remaining time :param progress_value: Current progress bar value :type progress_value: float :param time_elapsed: Time elepased since the beginning of the analysis (in sec) :type time_elapsed: float :param done: True if the analysis is done and false if still running :type done: bool

class cicada.gui.cicada_analysis_parameters_gui.SameFamilyWidgetsContainer(widgets, parent=None)[source]

A QFrame used to group widgets that belongs to a same group. Just useful for visual purposes

to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

class cicada.gui.cicada_analysis_parameters_gui.SliderWidget(analysis_arg, parent=None)[source]

Used to set a numerical value

get_value()[source]

Return the value of the widget Returns:

set_value(value)[source]

Set the widget value to the value passed Returns:

to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

class cicada.gui.cicada_analysis_parameters_gui.TextEditWidget(analysis_arg, parent=None)[source]
get_value()[source]

Return the value of the widget Returns:

set_value(value)[source]

Set the widget value to the value passed Returns:

to_stretch()[source]

Indicate if the widget should take all the space of a horizontal layout how might share the space with another widget Returns: Boolean

class cicada.gui.cicada_analysis_parameters_gui.Worker(name, cicada_analysis, analysis_arguments_handler, parent)[source]

Thread to manage multiple analysises at the same time

run()[source]

Run the analysis

setProgress(name, time_elapsed=0, increment_value=0, new_set_value=0)[source]

Emit the new value of the progress bar and time remaining

Parameters
  • name (str) – Analysis ID

  • time_elapsed (float) – Start elpased (in sec)

  • increment_value (float) – Value that should be added to the current value of the progress bar

  • new_set_value (float) – Value that should be set as the current value of the progress bar

set_results_path(results_path)[source]

Set the selected path to the results in the “Open result folder” button in the corresponding overview

Parameters

results_path (str) – Path to the results

cicada.gui.cicada_analysis_parameters_gui.except_hook(cls, exception, traceback)[source]

Redirect exception to std.err so we can display stack trace on exceptions