Skip to content

JSON representations for jupyter lab

Explanation of changes

In Jupyter notebook one can create nice representations of objects by adding _repr_json_ method (other methods such as _repr_html_ exist as well).

This PR shows a possible representation for part of the Schedule class. An example of the old and new representation of the resource_dict is below.

image

Motivation of changes

This PR is inspired by the representation of the xarray.Dataset. Besides the Schedule many other classes could benifit of better represetations. For example the MeasurementControl could have a representation showing the current gettables, settables and other properties.

@AdriaanRol


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 has been updated (when applicable).
  • CI pipelines pass
    • black code-formatting 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).
Edited by Victor Negîrneac

Merge request reports

Loading