pyplt.gui.experiment.dataset package

Submodules

pyplt.gui.experiment.dataset.loading module

class pyplt.gui.experiment.dataset.loading.DataLoadingTab(parent, parent_window)

Bases: tkinter.Frame

GUI tab for the data set loading stage of setting up an experiment.

Extends the class tkinter.Frame.

Populates the frame widget.

Parameters:
  • parent (tkinter widget) – the parent widget of this frame widget.
  • parent_window (tkinter.Toplevel) – the window which will contain this frame widget.
get_data()

Get the loaded data.

If the single file format is used, a single pandas.DataFrame containing the data is returned. If the dual file format is used, a tuple containing both the objects and ranks (each a pandas.DataFrame) is returned.

Returns:the loaded data.
Return type:pandas.DataFrame or tuple of pandas.DataFrame (size 2)
get_objects_path()

Get the objects file path, if applicable.

Returns:the objects file path.
Return type:str
get_rank_derivation_params()

Get the values of the rank derivation parameters (minimum distance margin and memory).

These only apply when a single file format is used.

Returns:tuple containing the values of both parameters.
Return type:tuple (size 2)
get_ranks_path()

Get the ranks file path, if applicable.

Returns:the ranks file path.
Return type:str
get_single_path()

Get single file path, if applicable.

Returns:the single file path.
Return type:str
is_data_loaded()

Check if a full data set has been loaded.

A full data set consists of either both a valid objects file and a valid and compatible ranks file or a valid single file.

Returns:boolean indicating whether or not a full data set is loaded.
Return type:bool
is_new_data()

One-time check to verify whether new data (which may override any previously loaded data) has been loaded.

If self._new_data is true, it is reset to False before this method returns True.

Returns:boolean indicating whether or not new data has been loaded (i.e., True if self._new_data is True; False otherwise).
Return type:bool

pyplt.gui.experiment.dataset.params module

class pyplt.gui.experiment.dataset.params.Confirmation

Bases: enum.Enum

Class specifying enumerated constants for loading confirmation states.

Extends enum.Enum.

CANCEL = 0
DONE = 1
class pyplt.gui.experiment.dataset.params.LoadingFoldsWindow(parent, file_path, parent_window, is_dual_format)

Bases: tkinter.Toplevel

GUI window for specifying the parameters for loading data from a file.

Extends the class tkinter.Toplevel.

Populates the window widget with widgets to specify loading parameters and a data set preview frame.

Parameters:
  • parent (tkinter widget) – the parent widget of this window widget.
  • file_path (str) – the path of the file to be loaded.
  • parent_window (tkinter.Toplevel) – the window which this window widget will be stacked on top of.
  • is_dual_format (bool) – specifies whether the dual file format was used to load the dataset or not (single file format).
get_confirmation()

Get the confirmation variable indicating whether or not the file load has been completed or cancelled.

Returns:the confirmation variable for the file that was attempted to be loaded.
Return type:pyplt.gui.experiment.dataset.params.Confirmation
get_data()

Get the data extracted and processed from the file being loaded.

Returns:the extracted data.
Return type:pandas.DataFrame
class pyplt.gui.experiment.dataset.params.LoadingParamsWindow(parent, file_path, parent_window, file_type)

Bases: tkinter.Toplevel

GUI window for specifying the parameters for loading data from a file.

Extends the class tkinter.Toplevel.

Populates the window widget with widgets to specify loading parameters and a data set preview frame.

Parameters:
  • parent (tkinter widget) – the parent widget of this window widget.
  • file_path (str) – the path of the file to be loaded.
  • parent_window (tkinter.Toplevel) – the window which this window widget will be stacked on top of.
  • file_type (pyplt.util.enums.FileType.) – the type of file to be loaded.
get_confirmation()

Get the confirmation variable indicating whether or not the file load has been completed or cancelled.

Returns:the confirmation variable for the file that was attempted to be loaded.
Return type:pyplt.gui.experiment.dataset.params.Confirmation
get_data()

Get the data extracted and processed from the file being loaded.

Returns:the extracted data.
Return type:pandas.DataFrame
get_rank_derivation_params()

Get the values of the rank derivation parameters (minimum distance margin and memory).

These only apply when a single file format is used.

Returns:tuple containing the values of both parameters.
Return type:tuple (size 2)

pyplt.gui.experiment.dataset.preview module

class pyplt.gui.experiment.dataset.preview.DataSetPreviewFrame(master, df, heads_bg_colour='#106690', heads_text_colour='white', style_prefix='')

Bases: object

GUI frame for previewing datasets loaded into PLT.

Instantiates a tkinter.Canvas object containing the frame previewing the data.

Parameters:
  • master (tkinter widget) – the parent widget of the data preview canvas widget.
  • df (pandas.DataFrame) – the data to be previewed.
  • heads_bg_colour (str, optional) – the background colour to be used for the column headers (representing feature names) in the preview (default pyplt.gui.util.colours.PREVIEW_DEFAULT).
  • heads_text_colour (str, optional) – the text colour to be used for the column headers (representing feature names) in the preview (default ‘white’).
  • style_prefix (str, optional) – specifies an additional prefix to add to the name of the style used for themed ttk widgets (should include a dot character at the end) (default ‘’).
destroy_preview()

Destroy the preview frame widget and the canvas widget containing it.

update(df)

Update the preview frame with the given data.

Parameters:df (pandas.DataFrame) – the data to be previewed.
update_column(col_id, new_values)

Update the values of a single column in the preview (e.g., for normalization).

Parameters:
  • col_id (int) – the index of the column to be updated.
  • new_values (array-like) – the new values to be displayed in the given column.

Module contents

This package contains GUI-based modules that manage the data set loading stage of setting up an experiment.