ClusteringController

class ClusteringController(available_subclasses: Optional[Mapping[str, List[str]]] = None, **kwargs)

Bases: MetaController

Subclass of MetaController for managing clustering view-model logic.

Handles queries, data relaying, and view updates.

Public Methods

ClusteringController.alter_database_status(status: bool) None

Inform the view whether database alteration was successful.

Parameters:

status (bool) – Result of the database alteration operation.

ClusteringController.check_cluster_column_exists(table_name: str) None

Notify the view to check if a cluster column exists in the given table.

Parameters:

table_name (str) – Name of the table to check.

ClusteringController.display_write_status(status: bool) None

Notify the display panel whether clustering data was successfully written to the database.

Parameters:

status (bool) – True if the write succeeded, False otherwise.

ClusteringController.relay_event_data_generator(generator: Generator) None

Send an event data generator object to the view for processing.

Parameters:

generator (Generator) – Generator yielding event data entries.

ClusteringController.relay_plot_data(data: Any) None

Relay processed clustering data to the view for plotting.

Parameters:

data (Any) – Data structure containing plot information.

ClusteringController.relay_query(query: str, debug: str, table_name: str) None

Relay the SQL query and target table to the view for display or execution.

Parameters:
  • query (str) – SQL query string to execute or preview.

  • debug (str) – Optional debug message to display.

  • table_name (str) – Name of the database table being queried.

ClusteringController.relay_units(units: Dict[str, str | None]) None

Provide units associated with each column to the view.

Parameters:

units (Dict[str, Optional[str]]) – Dictionary mapping column names to units.

ClusteringController.update_column_names(column_names: List[str]) None

Update the view with a new list of column names from the database.

Parameters:

column_names (List[str]) – List of column names to populate axis selection.

ClusteringController.update_column_units(column_units: str | None, axis: str) None

Update unit labels for a given axis in the view.

Despite the parameter names, this is a get_column_units callback: it receives the unit string for a single column (None if the loader has none) followed by that column’s name.

Parameters:
  • column_units (Optional[str]) – Unit string for the column named by axis, or None if the loader could not resolve one.

  • axis (str) – Name of the column whose unit was resolved.

Private Methods

ClusteringController._init() None

Initialize the clustering view and model components.

ClusteringController._setup_connections() None

Connect internal view signals to their corresponding controller slots.