ClusteringControls

class ClusteringControls(parent: Optional[QWidget] = None)

Bases: MetaControls

Public Methods

ClusteringControls.collect_parameters() → dict

Collect current input values from the UI widgets.

Gathers selected values from the database loader, X label, and Y label combo boxes. Defaults to “No Event Database” or None where appropriate.

Returns:

A dictionary containing the current selections.

Return type:

dict

ClusteringControls.connect_signals() → None

Connects signals to corresponding methods.

ClusteringControls.on_button_clicked(button_type: str) → None

Handles button clicks and emits appropriate signals.

ClusteringControls.on_label_changed() → None

Handle changes in either the X or Y label combo box.

This function can be extended to trigger updates or validations when a label selection changes.

ClusteringControls.on_loader_changed() → None

Handles parameter changes and emits an action signal.

ClusteringControls.retranslateUi() → None

Update translated UI strings.

Typically used in Qt for re-applying translations, currently unused.

ClusteringControls.setupUi() → None
ClusteringControls.update_clusters(clusters: Sequence[Any]) → None

Update the X and Y label combo boxes with the provided cluster labels.

Parameters:

clusters (Sequence[Any]) – A sequence of cluster identifiers to populate the combo boxes. Values are stringified before display, so any type is accepted.

ClusteringControls.update_loaders(loaders: list[str]) → None

Update the database loader combo box with available loader names.

Preserves the current selection if it’s still valid; otherwise, defaults to the first available loader.

Parameters:

loaders (list[str]) – A list of loader names (strings) to populate the combo box.

ClusteringControls.update_units(comboBox: QComboBox, units_label: QLabel) → None

Update units based on the selected column in the comboBox and emit an update signal.

ClusteringControls.validate_inputs() → None

Validates input fields and enables/disables buttons accordingly.

Private Methods

ClusteringControls.__init__(parent: QWidget | None = None) → None

Initialize the ClusteringControls widget.

Sets up the UI, connects signals, and performs initial input validation.

Parameters:

parent (Optional[QWidget]) – Parent widget that owns these controls.