Marimo

Marimo interface.

Usage, inside a Marimo notebook:

from qibocal_widgets import Executor
from qibocal_widgets.marimo import Marimo

executor = Executor.create(platform=platform, path="var/report", frontends=[Marimo()])
with executor:
    acquired = executor.acquire(bound, targets=[0, 1])
acquired  # rendered: raw data tables

completed = executor(bound)
completed  # rendered: raw data tables and per-target reports

The show_data() and show_reports() helpers remain available for explicit, finer-grained control, and wrap() makes any execution displayable.

class qibocal_widgets.marimo.Marimo

Bases: qibocal_widgets.frontend.Frontend

Display executions in Marimo, with display().

Compatible with Jupyter: each frontend uses its own view.

protocol: ClassVar[str] = '_display_'

Display protocol implemented, i.e. the key of the view.

render(completed)

Displayable object for an execution.

Parameters:

completed (Completed)

Return type:

Any

background()

Reactive pending executions, run in mo.Thread, in notebooks.

Return type:

tuple[type[Pending], type[Thread]] | None

confirmable()

In notebooks, where the Run button can be clicked.

Return type:

bool

submitted(pending)

Follow the execution in the cell run submitting it, new or reused.

A mo.Thread of the current run replaces the displayed output with the progress, then the result, and launches the execution when confirmed or run again. It stops when the cell runs again: the new run follows the execution itself, if it submits it again (e.g. reused).

Parameters:

pending (Pending)

Return type:

None

render_pending(pending)

A spinner while running, then the result (or the error).

The spinner becomes a progress bar when the duration of the acquisition is estimated, starting again on each refined estimate.

Displayed as the output of the cell which submitted it, the spinner is replaced by the result when the execution completes (unless other pending executions are displayed in the same cell).

Parameters:

pending (Pending)

Return type:

Any

qibocal_widgets.marimo.display(completed, actions=())

Full rendering of an execution: data and, when available, reports.

Above them, buttons: the given actions, and the platform update of a fitted execution, if not applied automatically (see Completed.update).

Parameters:
Return type:

Html

qibocal_widgets.marimo.show_data(data)

Accordion of raw data tables, one entry per target.

Parameters:

data (Any) – a Qibocal Data instance, or an execution (Completed), in which case its acquired data is used.

Return type:

Html

qibocal_widgets.marimo.show_reports(reports_, updates=None)

Accordion of reports (figures and fit tables), one entry per target.

Parameters:
  • reports – the reports attribute of an execution, or the execution itself.

  • updates (Updates | None) – the platform update of the execution, if any: each target gets an Update button, when the update applies per target.

  • reports_ (Any)

Return type:

mo.Html

qibocal_widgets.marimo.wrap(completed)

Make any execution display itself in Marimo.

Parameters:

completed (Completed)

Return type:

Completed