MetaView

class MetaView()

Bases: QWidget, WalkthroughMixin

Abstract base class designed to provide a unified interface for different analysis tabs.

This class includes a blank plot canvas for visualizing data, a dedicated space for control elements, and an interface for dynamically updating the plot based on user interactions or analysis results.

Public Methods

Abstract Methods

These methods must be implemented by subclasses.

abstractmethod MetaView.handle_parameter_change(submodel_name: str, action_name: str, args: tuple) → None

React to an action the tab’s controls panel has emitted.

Abstract because _set_control_area connects the panel’s actionTriggered signal straight to it while the View is still being constructed, so a tab that does not provide it raises AttributeError out of __init__ before it can ever be shown. Declaring it here is what turns that into a refusal to instantiate the class at all, which is the only form of the failure that names the cause. The three sibling handlers _set_control_area connects beside it - handle_edit_triggered, handle_add_triggered and handle_delete_triggered - are concrete on this class and need no implementation.

A tab that lays out its own control area by overriding _set_control_area never has this connected, and may implement it as a no-op.

Parameters:
  • submodel_name (str) – Name of the controls submodel the action came from.

  • action_name (str) – Identifier of the action to perform.

  • args (tuple) – The action’s arguments, as the controls panel packed them.

Returns:

None

Return type:

None

abstractmethod MetaView.notify_plugin_state_changed(metaclass: str, plugin_key: str, reason: str) → None

Called by MainController whenever any plugin instance’s internal state changed elsewhere in the app (e.g. new columns committed to a loader’s table). Must be implemented by subclasses, even if the correct implementation is a no-op (pass).

Where the implementation is not a no-op, it must make a deliberate decision about whether the notification applies to this tab, filter accordingly, and determine what the specific reaction should be.

Currently known (metaclass, reason) combinations in use:

  • (“MetaDatabaseLoader”, <loader_key>, “columns”) — emitted after columns are added to a loader’s table (see ClusteringView._commit_clusters, ProteinView._commit_fits).

Parameters:
  • metaclass (str) – The metaclass of the plugin instance whose state changed (e.g. “MetaDatabaseLoader”).

  • plugin_key (str) – The unique key identifying the plugin instance that changed (e.g. “SQLiteDBLoader_0”).

  • reason (str) – A short string identifying what kind of change occurred (e.g. “columns”). Free-form; the emitter and every receiver must agree on the exact string used.

Returns:

None

Return type:

None

abstractmethod MetaView.update_available_plugins(available_plugins: Dict[str, List[str]]) → None

Called whenever a new plugin is instantiated elsewhere in the app, to keep an up-to-date list of possible data sources for use by this plugin.

Parameters:

available_plugins (Dict[str, List[str]]) – Dict of lists keyed by MetaClass, listing the identifiers of all instantiated plugins throughout the app.

Concrete Methods

MetaView.handle_add_triggered(metaclass: str) → None

Trigger addition of a new plugin by prompting for a subclass.

Parameters:

metaclass (str) – The type of plugin to add (e.g., ‘MetaReader’)

MetaView.handle_delete_triggered(metaclass: str, key: str) → None

Emit a signal to trigger the delete process for a data plugin, passing the identifier.

Parameters:
  • metaclass (str) – The class type of the plugin

  • key (str) – the identifier of the plugin to be deleted

MetaView.handle_edit_triggered(metaclass: str, key: str) → None

Emit a signal to trigger the saving process for a data plugin, passing the appropriate arguments to handle editing plugin settings.

Parameters:
  • metaclass (str) – The class type of the plugin

  • key (str) – the identifier of the plugin to be edited

MetaView.handle_kill_all() → None

Handle the ‘Kill All’ button click event.

MetaView.handle_kill_button(identifier: str) → None

Handle the kill button click event for individual workers.

MetaView.remove_progress_bar(identifier: str) → None

Remove a specific progress bar and its components when a task is complete.

MetaView.set_available_subclasses(available_subclasses: Mapping[str, List[str]] | None) → None
MetaView.update_actions_from_json(actions: Dict[str, Dict[str, Any]]) → None
MetaView.update_plot_data(data: Any | None) → None
MetaView.update_progressbar(value: float, identifier: str) → None

Update a specific progress bar’s value or create it if it doesn’t exist.

Private Methods

Abstract Methods

These methods must be implemented by subclasses.

abstractmethod MetaView._init() → None

Perform additional initialization specific to the algorithm being implemented. Must be implemented by subclasses.

This function is called at the end of the class constructor to perform additional initialization specific to the algorithm being implemented. kwargs provided to the base class constructor are available as class attributes.

abstractmethod MetaView._reset_actions(axis_type: str = '2d') → None

Clears the figure and reinitializes axes. This will also add a flag to the tab action history if @register_action is being used to keep track of actions. Only actions applied after the most recent call to this function will be recreated if the related file is loaded.

Parameters:

axis_type (str) – Either ‘2d’ or ‘3d’ to determine plot projection.