EventAnalysisView

class EventAnalysisView()

Bases: MetaEventTabView

Subclass of MetaEventTabView for visualizing and interacting with event-based signal analysis.

Handles event plotting, plugin integration, and user-triggered actions.

Public Methods

EventAnalysisView.get_current_view() → str

Abstract method to get the name of the current view.

Subclasses must override this to return the current view name.

Returns:

The name of the view currently displayed.

Return type:

str

Raises:

NotImplementedError – Always, unless overridden by a subclass.

EventAnalysisView.get_save_filename() → str

Open a file dialog to let the user select a filename for saving a CSV file.

Returns:

Absolute path to the selected file.

Return type:

str

EventAnalysisView.get_walkthrough_steps() → List[Tuple[str, str, str, Callable[[], QWidget | List[QWidget]]]]

Abstract method to retrieve the walkthrough steps for the current view.

Subclasses must override this to return a list of walkthrough steps, each a (title, description, view name, widget getter) tuple.

Returns:

The ordered walkthrough steps for this view.

Return type:

List[WalkthroughStep]

Raises:

NotImplementedError – Always, unless overridden by a subclass.

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

Handle changes triggered by UI controls such as updates to axis selection or filters.

Parameters:
  • submodel_name (str) – Name of the submodel that triggered the action.

  • action_name (str) – Name of the action triggered.

  • args (tuple) – Tuple containing action-specific arguments.

EventAnalysisView.set_event_plot_data(event_data: Sequence[ndarray[tuple[int, ...], dtype[float64]]], time_bases: Sequence[ndarray[tuple[int, ...], dtype[float64]]], labels: Sequence[str], num_events: int, vertical_lines: Sequence[List[float] | None], horizontal_lines: Sequence[List[float] | None], points: Sequence[List[Tuple[float, float]] | None], vlabels: Sequence[Sequence[str | None] | None], hlabels: Sequence[Sequence[str | None] | None], plabels: Sequence[Sequence[str | None] | None], use_raw: bool) → None

Draw the events the Controller assembled, or report that there were none.

The six feature sequences carry one entry per event while event_data and labels carry one to three per event, so this method must not try to line them up - the Controller built them aligned and _update_event_plot indexes them by event.

Parameters:
  • event_data (Sequence[npt.NDArray[np.float64]]) – the traces to draw, in order

  • time_bases (Sequence[npt.NDArray[np.float64]]) – one time axis per trace, index-aligned with event_data

  • labels (Sequence[str]) – one label per trace, index-aligned with event_data

  • num_events (int) – how many events those traces belong to

  • vertical_lines (Sequence[Optional[List[float]]]) – per event, its vertical feature lines or None

  • horizontal_lines (Sequence[Optional[List[float]]]) – per event, its horizontal feature lines or None

  • points (Sequence[Optional[List[Tuple[float, float]]]]) – per event, its labelled feature points or None

  • vlabels (Sequence[Optional[Sequence[Optional[str]]]]) – per event, the labels for its vertical lines or None

  • hlabels (Sequence[Optional[Sequence[Optional[str]]]]) – per event, the labels for its horizontal lines or None

  • plabels (Sequence[Optional[Sequence[Optional[str]]]]) – per event, the labels for its points or None

  • use_raw (bool) – whether unfiltered traces are among those being drawn

Returns:

None

Return type:

None

EventAnalysisView.set_fitting_statuses(eventfitter: str, statuses: List[Tuple[int, bool]], data_filter: str) → None

Confirm any already-fitted channels, then ask for the approved ones to run.

The per-channel prompt is kept exactly as it was, including that declining one channel skips only that channel. There are no stored ranges to look up here, so unlike RawData’s equivalent nothing in this half can fail.

Parameters:
  • eventfitter (str) – the event fitter plugin’s key

  • statuses (List[Tuple[int, bool]]) – (channel, already_fitted) for each channel that answered

  • data_filter (str) – the filter plugin’s key, or “” for no filtering

Returns:

None

Return type:

None

EventAnalysisView.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.

EventAnalysisView.update_channels(channels: List[int]) → None

Update the channel list in the event analysis control widget.

Parameters:

channels (List[int]) – List of available channel indices.

EventAnalysisView.update_plot() → None

Update the main plot with the latest data and features. This method should be called after data and parameters are updated.

Private Methods

EventAnalysisView._init() → None

Initialize the EventAnalysisView. Called after constructor. Used to set up internal variables or state as needed.