EventAnalysisController¶
class EventAnalysisController(available_subclasses: Optional[Mapping[str, List[str]]] = None, **kwargs)
Bases: MetaController
Subclass of MetaController for for managing event analysis view-model logic.
Connects the EventAnalysisModel and EventAnalysisView.
Public Methods¶
- EventAnalysisController.relay_eventfitting_status(status: bool) None¶
Relay event fitting status to the view.
- Parameters:
status (bool) – Boolean indicating the success of event fitting.
- EventAnalysisController.set_event_filter(data_filter: Callable) None¶
Set the callable function used to filter event data.
- Parameters:
data_filter (Callable) – A function that applies filtering logic to event data.
- EventAnalysisController.set_eventfitting_status(status: bool) None¶
Set the current status of the event fitting process in the view.
- Parameters:
status (bool) – Boolean indicating if event fitting was successful.
- EventAnalysisController.set_num_events_allowed(num_events: int) None¶
Set the maximum number of events allowed for processing or display.
- Parameters:
num_events (int) – Maximum number of events to handle.
- EventAnalysisController.update_available_plugins(available_plugins: dict) None¶
Relay an updated dict of available plugin keys, keyed by metaclass, to both the model and the view.
- Parameters:
available_plugins (dict) – dict of lists keyed by MetaClass, listing the identifiers of all instantiated plugins throughout the app.
- EventAnalysisController.update_channels(channels: List[int]) None¶
Update the view with the current number of channels available or selected.
- Parameters:
channels (List[int]) – List of channel identifiers.
- EventAnalysisController.update_features(vertical: List[float] | None = None, horizontal: List[float] | None = None, points: List[Tuple[float, float]] | None = None, vlabels: List[str] | None = None, hlabels: List[str] | None = None, plabels: List[str] | None = None) None¶
Update the plot with visual annotations including vertical lines, horizontal lines, and point markers.
Validates that each visual feature has a corresponding label (or explicit None) if labels are provided.
- Parameters:
vertical (Optional[List[float]]) – Vertical line positions for the event being plotted.
horizontal (Optional[List[float]]) – Horizontal line positions for the event being plotted.
points (Optional[List[Tuple[float, float]]]) – (x, y) point coordinates for the event being plotted.
vlabels (Optional[List[str]]) – Labels for the vertical lines.
hlabels (Optional[List[str]]) – Labels for the horizontal lines.
plabels (Optional[List[str]]) – Labels for the point markers.
- Raises:
ValueError – If a label list is provided and its length does not match the corresponding feature list.
Private Methods¶
- EventAnalysisController._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.