Add measurement_description method to MC

Explanation of changes

This PR adds a method measurement_description to the MeasurementControl. The goal is to give a compact, serializable description of the measurement performed. Users can extend the description with additional information.

Minimal example:

import tempfile
import numpy as np
import pyqtgraph
import qcodes
import quantify_core.visualization.pyqt_plotmon as pqm
from qcodes import find_or_create_instrument
from quantify_core.data.handling import (get_datadir,     set_datadir)
from quantify_core.measurement import MeasurementControl
from quantify_core.visualization.instrument_monitor import InstrumentMonitor
_ = pyqtgraph.mkQApp()

set_datadir(tempfile.mkdtemp(prefix='quantify-test-data-'))
print(f"Data will be saved in:\n{get_datadir()}")

p=qcodes.ManualParameter('p')
q=qcodes.Parameter('amplitude', get_cmd = lambda : np.sin(p()))

MC = find_or_create_instrument(MeasurementControl, 'MC')
plotmon = find_or_create_instrument(pqm.PlotMonitor_pyqt, 'plotmon')
MC.instr_plotmon(plotmon.name)
insmon = find_or_create_instrument(InstrumentMonitor, "Instruments Monitor")
MC.instrument_monitor(insmon.name)

# %% Simple 1D scan loop

MC.settables(p)
MC.setpoints(np.linspace(0, 40, 34))
MC.gettables(q)

dataset = MC.run('1D charge stability diagram')
print(dataset)
print(MC.measurement_description())

The output of the measurement_description() is:

image

Motivation of changes

In a followup PR methods to store and load the description can be added. (Perhaps via dataset.qcore once merged)

@caenrigen @kel85uk


Merge checklist

See also merge request guidelines

  • Merge request has been reviewed and approved by a project maintainer.
  • Merge request contains a clear description of the proposed changes and the issue it addresses.
  • Merge request made onto appropriate branch (develop for most MRs).
  • New code is fully tested.
  • New code is documented and docstrings use numpydoc format.
  • CHANGELOG.rst and AUTHORS.rst have been updated (when applicable).
  • CI pipelines pass
    • pre-commit run --all-files --hook-stage commit passes (gitlab-ci),
    • test suite passes (gitlab-ci),
    • no degradation in code-coverage (codacy),
    • no (serious) new pylint code quality issues introduced (codacy),
    • documentation builds successfully (CI and readthedocs),
    • windows tests pass (manually triggered by maintainers before merging).

For reference, the issues workflow is described in the contribution guidelines.

Edited by Pieter Eendebak

Merge request reports

Loading