Jupyter

Jupyter interface.

Usage, inside a Jupyter notebook:

from qibocal_widgets import Executor
from qibocal_widgets.jupyter import Jupyter

executor = Executor.create(platform=platform, path="var/report", frontends=[Jupyter()])
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

Rendering relies on ipywidgets.

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

class qibocal_widgets.jupyter.Jupyter

Bases: qibocal_widgets.frontend.Frontend

Display executions in Jupyter, with display().

Compatible with Marimo: each frontend uses its own view.

protocol: ClassVar[str] = '_repr_mimebundle_'

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

render(completed)

Displayable object for an execution.

Parameters:

completed (Completed)

Return type:

Any

confirmable()

In a kernel, where the Run button can be clicked.

Return type:

bool

render_pending(pending)

A live view: the Run button, if waiting for confirmation, the state (a progress bar, once estimated), then the result, with a Run again button.

Parameters:

pending (Pending)

Return type:

Any

qibocal_widgets.jupyter.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:
  • completed (Completed)

  • actions (Sequence[Widget])

Return type:

Widget

qibocal_widgets.jupyter.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:

Widget

qibocal_widgets.jupyter.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:

widgets.Widget

qibocal_widgets.jupyter.wrap(completed)

Make any execution display itself in Jupyter.

Parameters:

completed (Completed)

Return type:

Completed