Skip to main content

AutoDepGraph

PyPI Build Status Codacy Badge Coverage Status DOI

AutoDepGraph is a framework for using dependency graphs to calibrate a system. It is heavily inspired by "Physical qubit calibration on a directed acyclic graph".

Overview

AutoDepGraph consists of two main classes, the CalibrationNode and the Graph. Calibration is done by calling a node that one wants to execute, the node contains the logic required to satisfy the nodes it depends on (parents).

A CalibrationNode contains:

  • parameters

    • state
      • Good (green): check passes
      • needs calibration (yellow): calibration is not up to date anymore and needs to be updated
      • Bad (red): calibration or check has failed
      • unknown (grayed): checks of the node should be run
      • active (blue): calibration or check in progress
    • parents: the nodes it depends on
    • children: nodes that depend on this node
    • check_function : name of function to be executed when check is called. This can be a method of another instrument.
    • calibrate_function : name of function to be executed when calibrate is called. This can be a method of another instrument.
    • calibration_timeout: time in (s) after which a calibration times out.
  • function

    • execute or call
      • Performs the logic of a node (check state, satisfy requirements) with the goal of moving to a "good" state
    • check
      • Performs checks to determine and the state of a node
    • calibrate
      • Executes the calibration routines of the node

A Graph is a container of nodes, it is used for:

  • new graphs can be created by instantiating a graph and then using the add_node method to define new nodes.
  • loading and saving the graph
  • real-time visualization using pyqtgraph
    • state of the node determines color of a node
    • if a node has no calibrate function defined it is a manual node and has a hexagonal instead of a circle as symbol
    • mouseover information lists more properties (planned)

Example calibration graph

Examples

For an introductory example see the example notebook. If you want to see how to use a specific function, see the tests located in the autodepgraph/tests folder.

Installation

  • Clone the repository
  • install the requirements
  • navigate to the repository and run pip install -e .
  • verify success of installation by running py.test

N.B. windows can be "problematic"

Installation on windows is a bit more difficult, this relates mostly to the installation of pygraphviz. To install graphviz and pygraphviz on windows follow these steps:

  • get the 64 bit version of graphviz for windows, copy it to e.g., program files and add the bin folder to the system path.
  • the 64 bit version lacks the libxml2.dll, you most likely have this from some other program. You can find this by searching for libxml2.dll in the program files folder. After that just copy paste it to the bin folder of graphviz.
  • get pygraphviz by downloading the master from github.
  • Now you will need to edit pygraphviz/graphviz.i and pygraphviz/graphviz_wrap.c according to the changes at https://github.com/Kagami/pygraphviz/tree/py3-windows-iobase. A reference can be found in the _install folder
  • Next install using
python setup.py install --include-path="C:\Program Files\graphviz-2.38_x64\include" --library-path="C:\Program Files\graphviz-2.38_x64\lib"
  • then install autodepgraph and test the installation using py.test

Acknowledgements

I would like to thank Julian Kelly for the idea of using a dependency graph for calibrations and for early discussions. I would like to thank Joe Weston for discussions and help in working out the initial design. I would like to acknowledge Livio Ciorciaro for disucssions and as a coauthor of this project.

Metadata

Release files for autodepgraph 0.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autodepgraph 0.3.5
File Size Uploaded
autodepgraph-0.3.5.tar.gz 11.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autodepgraph 0.3.5
File Interpreter ABI Platform
autodepgraph-0.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 23.0 kB

Release files / autodepgraph-0.3.5.tar.gz

Download URL autodepgraph-0.3.5.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2ffe1144c06c29bffa334d8b5acc96e8e827d89aee605cb4ad4fc20e33a663f7
BLAKE2b-256 checksum
How to use checksums
56b739ea4fb8e7db83624dda6137a1430802e41335c8c458a78480dfa3b76109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / autodepgraph-0.3.5-py3-none-any.whl

Download URL autodepgraph-0.3.5-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ded34a4e1209629a6898ec3d0be1c9373dd1a0dbf88919404a9d090542539fa7
BLAKE2b-256 checksum
How to use checksums
4ae93760a8a463ed64b5a6a7e33e274f7a52014c73748475064f575a3fa1c6f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.3.5 This release

2 release files

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page