From 00e2b829d50647ecd5310f0be41a2f90f614fde4 Mon Sep 17 00:00:00 2001 From: qguyk Date: Sun, 13 Mar 2022 10:59:15 +0200 Subject: [PATCH] Set minimum version of docutils to 0.14 and fix config builder gui (#77) Co-authored-by: Nikola Sibalic --- CHANGELOG.md | 3 +++ poetry.lock | 26 ++++++++++++++++---- pyproject.toml | 2 +- qualang_tools/config/__init__.py | 35 ++++++++++++++++++++++++--- qualang_tools/config/server/readme.md | 27 +++++++++++++++++++++ 5 files changed, 84 insertions(+), 9 deletions(-) create mode 100644 qualang_tools/config/server/readme.md diff --git a/CHANGELOG.md b/CHANGELOG.md index dd31277f..87148b8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Fixed - Interactive Plotting Toolbox - Fixed several small issues when loading a figure - Integration Weights Tool - When compressing and plotting integration weights, the correct label is shown. +- Set minimum version of docutils dependency to 0.14 +- Fix config builder GUI imports ### Added - Interactive Plotting Toolbox - Added default markers when fitting - Interactive Plotting Toolbox - Improved example and added a demo video +- readme for config builder GUI ## [0.7.0] ### Added diff --git a/poetry.lock b/poetry.lock index faeb0726..8fe129b5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -209,11 +209,11 @@ graph = ["objgraph (>=1.7.2)"] [[package]] name = "docutils" -version = "0.18.1" +version = "0.14" description = "Docutils -- Python Documentation Utilities" category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = "*" [[package]] name = "flake8" @@ -963,7 +963,7 @@ interplot = ["dill", "pypiwin32", "ipython"] [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "6179b336d29deca8ec5cf6434578dd2e7f05a8ee8e0826cbe97bfe18414142ff" +content-hash = "a8736bf354fa9f760ad17d0f7847a18f8336c5014b1153e3c1bd30f048253e23" [metadata.files] appnope = [ @@ -1001,6 +1001,9 @@ brotli = [ {file = "Brotli-1.0.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ee83d3e3a024a9618e5be64648d6d11c37047ac48adff25f12fa4226cf23d1c"}, {file = "Brotli-1.0.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:19598ecddd8a212aedb1ffa15763dd52a388518c4550e615aed88dc3753c0f0c"}, {file = "Brotli-1.0.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:44bb8ff420c1d19d91d79d8c3574b8954288bdff0273bf788954064d260d7ab0"}, + {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e23281b9a08ec338469268f98f194658abfb13658ee98e2b7f85ee9dd06caa91"}, + {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3496fc835370da351d37cada4cf744039616a6db7d13c430035e901443a34daa"}, + {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b83bb06a0192cccf1eb8d0a28672a1b79c74c3a8a5f2619625aeb6f28b3a82bb"}, {file = "Brotli-1.0.9-cp310-cp310-win32.whl", hash = "sha256:26d168aac4aaec9a4394221240e8a5436b5634adc3cd1cdf637f6645cecbf181"}, {file = "Brotli-1.0.9-cp310-cp310-win_amd64.whl", hash = "sha256:622a231b08899c864eb87e85f81c75e7b9ce05b001e59bbfbf43d4a71f5f32b2"}, {file = "Brotli-1.0.9-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:c83aa123d56f2e060644427a882a36b3c12db93727ad7a7b9efd7d7f3e9cc2c4"}, @@ -1012,12 +1015,18 @@ brotli = [ {file = "Brotli-1.0.9-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:40d15c79f42e0a2c72892bf407979febd9cf91f36f495ffb333d1d04cebb34e4"}, {file = "Brotli-1.0.9-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:93130612b837103e15ac3f9cbacb4613f9e348b58b3aad53721d92e57f96d46a"}, {file = "Brotli-1.0.9-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87fdccbb6bb589095f413b1e05734ba492c962b4a45a13ff3408fa44ffe6479b"}, + {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:6d847b14f7ea89f6ad3c9e3901d1bc4835f6b390a9c71df999b0162d9bb1e20f"}, + {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:495ba7e49c2db22b046a53b469bbecea802efce200dffb69b93dd47397edc9b6"}, + {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:4688c1e42968ba52e57d8670ad2306fe92e0169c6f3af0089be75bbac0c64a3b"}, {file = "Brotli-1.0.9-cp36-cp36m-win32.whl", hash = "sha256:61a7ee1f13ab913897dac7da44a73c6d44d48a4adff42a5701e3239791c96e14"}, {file = "Brotli-1.0.9-cp36-cp36m-win_amd64.whl", hash = "sha256:1c48472a6ba3b113452355b9af0a60da5c2ae60477f8feda8346f8fd48e3e87c"}, {file = "Brotli-1.0.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3b78a24b5fd13c03ee2b7b86290ed20efdc95da75a3557cc06811764d5ad1126"}, {file = "Brotli-1.0.9-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:9d12cf2851759b8de8ca5fde36a59c08210a97ffca0eb94c532ce7b17c6a3d1d"}, {file = "Brotli-1.0.9-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:6c772d6c0a79ac0f414a9f8947cc407e119b8598de7621f39cacadae3cf57d12"}, {file = "Brotli-1.0.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29d1d350178e5225397e28ea1b7aca3648fcbab546d20e7475805437bfb0a130"}, + {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7bbff90b63328013e1e8cb50650ae0b9bac54ffb4be6104378490193cd60f85a"}, + {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:ec1947eabbaf8e0531e8e899fc1d9876c179fc518989461f5d24e2223395a9e3"}, + {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:12effe280b8ebfd389022aa65114e30407540ccb89b177d3fbc9a4f177c4bd5d"}, {file = "Brotli-1.0.9-cp37-cp37m-win32.whl", hash = "sha256:f909bbbc433048b499cb9db9e713b5d8d949e8c109a2a548502fb9aa8630f0b1"}, {file = "Brotli-1.0.9-cp37-cp37m-win_amd64.whl", hash = "sha256:97f715cf371b16ac88b8c19da00029804e20e25f30d80203417255d239f228b5"}, {file = "Brotli-1.0.9-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e16eb9541f3dd1a3e92b89005e37b1257b157b7256df0e36bd7b33b50be73bcb"}, @@ -1025,6 +1034,9 @@ brotli = [ {file = "Brotli-1.0.9-cp38-cp38-manylinux1_i686.whl", hash = "sha256:b663f1e02de5d0573610756398e44c130add0eb9a3fc912a09665332942a2efb"}, {file = "Brotli-1.0.9-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:5b6ef7d9f9c38292df3690fe3e302b5b530999fa90014853dcd0d6902fb59f26"}, {file = "Brotli-1.0.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8a674ac10e0a87b683f4fa2b6fa41090edfd686a6524bd8dedbd6138b309175c"}, + {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e2d9e1cbc1b25e22000328702b014227737756f4b5bf5c485ac1d8091ada078b"}, + {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:b336c5e9cf03c7be40c47b5fd694c43c9f1358a80ba384a21969e0b4e66a9b17"}, + {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:85f7912459c67eaab2fb854ed2bc1cc25772b300545fe7ed2dc03954da638649"}, {file = "Brotli-1.0.9-cp38-cp38-win32.whl", hash = "sha256:35a3edbe18e876e596553c4007a087f8bcfd538f19bc116917b3c7522fca0429"}, {file = "Brotli-1.0.9-cp38-cp38-win_amd64.whl", hash = "sha256:269a5743a393c65db46a7bb982644c67ecba4b8d91b392403ad8a861ba6f495f"}, {file = "Brotli-1.0.9-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2aad0e0baa04517741c9bb5b07586c642302e5fb3e75319cb62087bd0995ab19"}, @@ -1032,6 +1044,9 @@ brotli = [ {file = "Brotli-1.0.9-cp39-cp39-manylinux1_i686.whl", hash = "sha256:16d528a45c2e1909c2798f27f7bf0a3feec1dc9e50948e738b961618e38b6a7b"}, {file = "Brotli-1.0.9-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:56d027eace784738457437df7331965473f2c0da2c70e1a1f6fdbae5402e0389"}, {file = "Brotli-1.0.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9bf919756d25e4114ace16a8ce91eb340eb57a08e2c6950c3cebcbe3dff2a5e7"}, + {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e4c4e92c14a57c9bd4cb4be678c25369bf7a092d55fd0866f759e425b9660806"}, + {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e48f4234f2469ed012a98f4b7874e7f7e173c167bed4934912a29e03167cf6b1"}, + {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9ed4c92a0665002ff8ea852353aeb60d9141eb04109e88928026d3c8a9e5433c"}, {file = "Brotli-1.0.9-cp39-cp39-win32.whl", hash = "sha256:cfc391f4429ee0a9370aa93d812a52e1fee0f37a81861f4fdd1f4fb28e8547c3"}, {file = "Brotli-1.0.9-cp39-cp39-win_amd64.whl", hash = "sha256:854c33dad5ba0fbd6ab69185fec8dab89e13cda6b7d191ba111987df74f38761"}, {file = "Brotli-1.0.9-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9749a124280a0ada4187a6cfd1ffd35c350fb3af79c706589d98e088c5044267"}, @@ -1083,8 +1098,9 @@ dill = [ {file = "dill-0.3.4.zip", hash = "sha256:9f9734205146b2b353ab3fec9af0070237b6ddae78452af83d2fca84d739e675"}, ] docutils = [ - {file = "docutils-0.18.1-py2.py3-none-any.whl", hash = "sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c"}, - {file = "docutils-0.18.1.tar.gz", hash = "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"}, + {file = "docutils-0.14-py2-none-any.whl", hash = "sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6"}, + {file = "docutils-0.14-py3-none-any.whl", hash = "sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6"}, + {file = "docutils-0.14.tar.gz", hash = "sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274"}, ] flake8 = [ {file = "flake8-4.0.1-py2.py3-none-any.whl", hash = "sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d"}, diff --git a/pyproject.toml b/pyproject.toml index 76661abc..2472f3ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dash-core-components = "^2.0.0" dash-bootstrap-components = "^1.0.0" dash-cytoscape = "^0.3.0" dash-table = "^5.0.0" -docutils = "^0.18.1" +docutils = "^0.14.0" dash-dangerously-set-inner-html = "^0.0.2" waitress = "^2.0.0" dill = { version = "^0.3.4", optional = true } diff --git a/qualang_tools/config/__init__.py b/qualang_tools/config/__init__.py index e5d93f60..30547e9a 100644 --- a/qualang_tools/config/__init__.py +++ b/qualang_tools/config/__init__.py @@ -4,13 +4,42 @@ plot_integration_weights, ) from qualang_tools.config.builder import ConfigBuilder +from qualang_tools.config.components import * +from qualang_tools.config.primitive_components import * __all__ = [ "convert_integration_weights", "compress_integration_weights", "plot_integration_weights", - "components", - "primitive_components", - "builder", + "Controller", + "ArbitraryWaveform", + "ConstantWaveform", + "DigitalWaveform", + "MeasurePulse", + "ControlPulse", + "Mixer", + "Element", + "MeasureElement", + "ConstantIntegrationWeights", + "ArbitraryIntegrationWeights", + "ElementCollection", + "ReadoutResonator", + "Transmon", + "FluxTunableTransmon", + "Coupler", + "Oscillator", + "Port", + "AnalogInputPort", + "AnalogOutputPort", + "DigitalInputPort", + "DigitalOutputPort", + "Waveform", + "Pulse", + "Operation", + "IntegrationWeights", + "Weights", + "DigitalSample", + "Matrix2x2", + "AnalogOutputFilter", "ConfigBuilder", ] diff --git a/qualang_tools/config/server/readme.md b/qualang_tools/config/server/readme.md new file mode 100644 index 00000000..07c53f5b --- /dev/null +++ b/qualang_tools/config/server/readme.md @@ -0,0 +1,27 @@ +# Feature + +GUI for creating configuration. It allows: +* Visualization of existing config +* Edits of existing fields +* Addition of components based on `ConfigBuilder` from `qualang_tools.config` + +# Use + +`python -m qualang_tools.config.gui` + +When edits are made, user can download two files `config_edits.py` that contains all the edits. If needed, user can manually change this `config_edits.py` file, e.g. to delete unwanted additions of components. + +# Restrictions + +* While configuration can be explored when being build from `components` of `ConfigBuilder`, currently it cannot be directly edited if the items are initially added as objects. On the other hand, if configuration is purely config variable (no component objects are used in building it), it can be edited through the GUI. + +# Possible future extensions + +* Object view (currently just config file is seen) +* Raw file view in GUI +* Support for parameters in GUI +* Back views (show who uses some resource in GUI) +* Allow adding new field in direct config editing using OpenAPI schema (currently schema is used just to show docs) +* Restrict more tightly field value edits in direct config editing (currently it's not checking beyond general data type for correctness of entered values) +* Parsing initial raw config as minimal object model (so that we can see in object view even existing configs build before ConfigBuilder is used) +* Implement lazy addition to allow deletion of objects from config builder (currently there is no option to delete added element other than manually editing corresponding config_edits.py file) \ No newline at end of file