mdadash.backend.state.manager

Manager for the dashboard state

Classes

StateManager(state_file)

State Manager

class mdadash.backend.state.manager.StateManager(state_file: str)[source]

Bases: object

State Manager

This class is repsonsible for managing the entire state of the dashboard application. It persists the state to disk and also restores it back when the dashboard server is re-launched.

The state dictionary has the following keys:

running_state: dict

The running state of the dashboard

settings: dict

All the values used in the dashboard settings page. This dict has the following keys:

universe_configs:

An array of universe configurations required to create MDAnalysis universes. These include the topology, trajectory, imdclient related params and any additional user-defined kwargs setup in the UI

widgets: dict

All the details about widget instances

widgets_layout: list

The layout details of the widgets on the dashboard GUI

alertID: int

The next auto-incrementing ID to use for a new alert

alerts: list

List of all the alerts

notebooks: dict

All the details about notebooks created

Variables:
  • state (dict) – The complete state dictionary

  • running_state (dict) – The running state of the dashboard

  • settings (dict) – All the values used in the dashboard settings page

  • dashboard_config (dict) – All the dashboard related config

  • universe_configs (dict) – All the universe(s) related config

  • widgets_layout (dict) – All the widgets layout info

  • widgets (dict) – All the widget instances info

  • alerts (list) – List of all the alerts

  • notebooks (dict) – All the notebooks created

async add_alert(data: dict) None[source]

Add alert to alerts array

async add_notebook(name='Untitled', description='', code='')[source]

Add new notebook to notebooks dict

property alerts: list

Alerts array

property dashboard_config: dict

Dashboard config dict

async duplicate_notebook(uuid)[source]

Duplicate notebook

load()[source]

Load state

property notebooks: dict

Notebooks dict

async remove_notebook(uuid)[source]

Remove notebook from notebooks dict

property running_state: dict

The running state dict of the dashboard

async save()[source]

Save state

property settings: dict

The complete settings dict

property state: dict

The complete state dict

property universe_configs: dict

All the unviverse configs dict

property widgets: dict

The widgets dict of the dashboard

property widgets_layout: list

The widgets layout array of the dashboard