Draft: Implement operations and schedules in terms of serializable traitlets

Explanation of changes

Drops UserDict implementation of schedule types and introduces serializable traitlets-based one instead.

Fixes #159

Fixes #146 (closed)

Motivation of changes

#159 proposes to reimplement schedule data structures in terms of dataclasses. This would be a solid improvement over current UserDict-based implementation, however it is not perfect.

Normally, our data structures require a lot of validation. The best currently available framework for data validation is traitlets, however, it supports only configuration, but not serialization (which is a required feature).

After a quick search I found straitlets -- an extension to traitlets that adds serialization. It is not widespread, but seems to be simple enough and in my opinion the best variant for implementing serializable data structures with validation and possibly observation.


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),
    • windows tests pass (manually triggered by maintainers before merging).

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

Edited by Victor Negîrneac

Merge request reports

Loading