QuLab 2.10.4__tar.gz → 2.10.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qulab-2.10.4 → qulab-2.10.6}/PKG-INFO +1 -1
- {qulab-2.10.4 → qulab-2.10.6}/QuLab.egg-info/PKG-INFO +1 -1
- {qulab-2.10.4 → qulab-2.10.6}/QuLab.egg-info/SOURCES.txt +2 -2
- {qulab-2.10.4 → qulab-2.10.6}/qulab/__init__.py +1 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/dicttree.py +19 -7
- {qulab-2.10.4 → qulab-2.10.6}/qulab/executor/cli.py +18 -14
- {qulab-2.10.4 → qulab-2.10.6}/qulab/executor/load.py +7 -7
- qulab-2.10.4/qulab/executor/transform.py → qulab-2.10.6/qulab/executor/registry.py +52 -1
- {qulab-2.10.4 → qulab-2.10.6}/qulab/executor/schedule.py +1 -1
- {qulab-2.10.4 → qulab-2.10.6}/qulab/scan/__init__.py +0 -1
- {qulab-2.10.4 → qulab-2.10.6}/qulab/scan/scan.py +3 -2
- {qulab-2.10.4 → qulab-2.10.6}/qulab/scan/utils.py +1 -1
- qulab-2.10.6/qulab/version.py +1 -0
- {qulab-2.10.4 → qulab-2.10.6}/tests/test_expression.py +1 -1
- qulab-2.10.4/qulab/version.py +0 -1
- {qulab-2.10.4 → qulab-2.10.6}/LICENSE +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/MANIFEST.in +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/QuLab.egg-info/dependency_links.txt +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/QuLab.egg-info/entry_points.txt +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/QuLab.egg-info/requires.txt +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/QuLab.egg-info/top_level.txt +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/README.md +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/pyproject.toml +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/__main__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/cli/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/cli/commands.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/cli/config.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/cli/decorators.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/executor/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/executor/analyze.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/executor/storage.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/executor/template.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/executor/utils.py +0 -0
- {qulab-2.10.4/qulab/scan → qulab-2.10.6/qulab}/expression.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/monitor/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/monitor/__main__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/monitor/config.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/monitor/dataset.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/monitor/event_queue.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/monitor/mainwindow.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/monitor/monitor.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/monitor/ploter.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/monitor/qt_compat.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/monitor/toolbar.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/scan/curd.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/scan/models.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/scan/optimize.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/scan/query.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/scan/record.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/scan/server.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/scan/space.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/__main__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/backend/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/backend/redis.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/base_dataset.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/chunk.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/dataset.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/file.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/models/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/models/base.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/models/config.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/models/file.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/models/ipy.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/models/models.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/models/record.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/models/report.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/models/tag.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/storage/storage.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/chat.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/device/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/device/basedevice.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/device/loader.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/device/utils.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/drivers/FakeInstrument.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/drivers/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/ipy_events.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/net/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/net/bencoder.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/net/cli.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/net/dhcp.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/net/dhcpd.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/net/kad.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/net/kcp.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/net/nginx.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/progress.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/client.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/exceptions.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/msgpack.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/msgpack.pyi +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/router.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/rpc.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/serialize.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/server.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/socket.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/utils.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/worker.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/sys/rpc/zmq_socket.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/tools/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/tools/connection_helper.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/typing.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/utils.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/visualization/__init__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/visualization/__main__.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/visualization/_autoplot.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/visualization/plot_circ.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/visualization/plot_layout.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/visualization/plot_seq.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/visualization/qdat.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/visualization/rot3d.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/qulab/visualization/widgets.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/setup.cfg +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/setup.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/src/qulab.h +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/tests/test_kad.py +0 -0
- {qulab-2.10.4 → qulab-2.10.6}/tests/test_scan.py +0 -0
@@ -12,6 +12,7 @@ QuLab.egg-info/top_level.txt
|
|
12
12
|
qulab/__init__.py
|
13
13
|
qulab/__main__.py
|
14
14
|
qulab/dicttree.py
|
15
|
+
qulab/expression.py
|
15
16
|
qulab/typing.py
|
16
17
|
qulab/utils.py
|
17
18
|
qulab/version.py
|
@@ -23,10 +24,10 @@ qulab/executor/__init__.py
|
|
23
24
|
qulab/executor/analyze.py
|
24
25
|
qulab/executor/cli.py
|
25
26
|
qulab/executor/load.py
|
27
|
+
qulab/executor/registry.py
|
26
28
|
qulab/executor/schedule.py
|
27
29
|
qulab/executor/storage.py
|
28
30
|
qulab/executor/template.py
|
29
|
-
qulab/executor/transform.py
|
30
31
|
qulab/executor/utils.py
|
31
32
|
qulab/monitor/__init__.py
|
32
33
|
qulab/monitor/__main__.py
|
@@ -40,7 +41,6 @@ qulab/monitor/qt_compat.py
|
|
40
41
|
qulab/monitor/toolbar.py
|
41
42
|
qulab/scan/__init__.py
|
42
43
|
qulab/scan/curd.py
|
43
|
-
qulab/scan/expression.py
|
44
44
|
qulab/scan/models.py
|
45
45
|
qulab/scan/optimize.py
|
46
46
|
qulab/scan/query.py
|
@@ -297,8 +297,8 @@ def update_tree(result, updates):
|
|
297
297
|
return result
|
298
298
|
|
299
299
|
|
300
|
-
def queryref_tree(q, keys, dct, prefix=[], chain=None):
|
301
|
-
q = q
|
300
|
+
def queryref_tree(q: str, keys, dct, prefix=[], chain=None):
|
301
|
+
q = q.removeprefix('$')
|
302
302
|
if q.startswith('.'):
|
303
303
|
while q.startswith('.'):
|
304
304
|
keys.pop()
|
@@ -340,7 +340,7 @@ class Env():
|
|
340
340
|
self.prefix = prefix
|
341
341
|
|
342
342
|
def get(self, name):
|
343
|
-
return queryref_tree(name
|
343
|
+
return queryref_tree(name,
|
344
344
|
self.keys,
|
345
345
|
self.dct,
|
346
346
|
prefix=self.prefix,
|
@@ -405,8 +405,9 @@ internal_functions = {
|
|
405
405
|
|
406
406
|
|
407
407
|
def eval_expr(expression, env=None, functions=None):
|
408
|
-
from pyparsing import (Forward, Literal,
|
409
|
-
|
408
|
+
from pyparsing import (Combine, Forward, Literal, MatchFirst, ParseResults,
|
409
|
+
Regex, Suppress, Word, ZeroOrMore, alphanums,
|
410
|
+
alphas, delimitedList, infixNotation, oneOf,
|
410
411
|
opAssoc, pyparsing_common)
|
411
412
|
if functions is None:
|
412
413
|
functions = internal_functions
|
@@ -436,8 +437,19 @@ def eval_expr(expression, env=None, functions=None):
|
|
436
437
|
'e': math.e
|
437
438
|
}.get(t[0]))
|
438
439
|
|
439
|
-
|
440
|
-
|
440
|
+
identifier = Word(alphas + '_', alphanums + '_')
|
441
|
+
dollar = Literal('$')
|
442
|
+
dot_sequence = Regex(r'\.{1,}')
|
443
|
+
attr = Combine(Literal('.') + identifier)
|
444
|
+
attr_chain = ZeroOrMore(attr)
|
445
|
+
dollar_named_chain = Combine(dollar + identifier + attr_chain)
|
446
|
+
dollar_dotN_chain = Combine(dollar + dot_sequence + identifier +
|
447
|
+
attr_chain)
|
448
|
+
dollar_simple = Combine(dollar + identifier)
|
449
|
+
|
450
|
+
variable = MatchFirst(
|
451
|
+
[dollar_dotN_chain, dollar_named_chain,
|
452
|
+
dollar_simple]).setParseAction(lambda s, l, t: lookup(t[0]))
|
441
453
|
|
442
454
|
bracket = Suppress('(') + expr + Suppress(')')
|
443
455
|
bracket.setParseAction(lambda s, l, t: t[0])
|
@@ -12,10 +12,10 @@ from ..cli.config import get_config_value, log_options
|
|
12
12
|
from ..cli.decorators import async_command
|
13
13
|
from .load import (WorkflowType, find_unreferenced_workflows, get_entries,
|
14
14
|
load_workflow, make_graph)
|
15
|
+
from .registry import Registry, set_config_api
|
15
16
|
from .schedule import CalibrationFailedError
|
16
17
|
from .schedule import maintain as maintain_workflow
|
17
18
|
from .schedule import run as run_workflow
|
18
|
-
from .transform import set_config_api
|
19
19
|
from .utils import workflow_template
|
20
20
|
|
21
21
|
|
@@ -95,6 +95,7 @@ def command_option(command_name):
|
|
95
95
|
'-c',
|
96
96
|
default=lambda: get_config_value("code", str, 'create'),
|
97
97
|
help='The path of the code.')
|
98
|
+
@log_options('create')
|
98
99
|
def create(workflow, code):
|
99
100
|
"""
|
100
101
|
Create a new workflow file.
|
@@ -124,12 +125,13 @@ def create(workflow, code):
|
|
124
125
|
'-a',
|
125
126
|
default=lambda: get_config_value("api", str, 'set'),
|
126
127
|
help='The modlule name of the api.')
|
128
|
+
@log_options('set')
|
127
129
|
def set(key, value, api):
|
128
130
|
"""
|
129
131
|
Set a config.
|
130
132
|
"""
|
131
133
|
logger.info(f'[CMD]: set {key} {value} --api {api}')
|
132
|
-
|
134
|
+
reg = Registry()
|
133
135
|
if api is not None:
|
134
136
|
api = importlib.import_module(api)
|
135
137
|
set_config_api(api.query_config, api.update_config, api.delete_config,
|
@@ -138,7 +140,7 @@ def set(key, value, api):
|
|
138
140
|
value = eval(value)
|
139
141
|
except:
|
140
142
|
pass
|
141
|
-
|
143
|
+
reg.set(key, value)
|
142
144
|
|
143
145
|
|
144
146
|
@click.command()
|
@@ -147,17 +149,18 @@ def set(key, value, api):
|
|
147
149
|
'-a',
|
148
150
|
default=lambda: get_config_value("api", str, 'get'),
|
149
151
|
help='The modlule name of the api.')
|
152
|
+
@log_options('get')
|
150
153
|
def get(key, api):
|
151
154
|
"""
|
152
155
|
Get a config.
|
153
156
|
"""
|
154
157
|
logger.info(f'[CMD]: get {key} --api {api}')
|
155
|
-
|
158
|
+
reg = Registry()
|
156
159
|
if api is not None:
|
157
160
|
api = importlib.import_module(api)
|
158
161
|
set_config_api(api.query_config, api.update_config, api.delete_config,
|
159
162
|
api.export_config, api.clear_config)
|
160
|
-
click.echo(
|
163
|
+
click.echo(reg.get(key))
|
161
164
|
|
162
165
|
|
163
166
|
@click.command()
|
@@ -176,7 +179,7 @@ def get(key, api):
|
|
176
179
|
@click.option('--veryfy-source-code',
|
177
180
|
is_flag=True,
|
178
181
|
help='Veryfy the source code.')
|
179
|
-
@log_options
|
182
|
+
@log_options('run')
|
180
183
|
@command_option('run')
|
181
184
|
@async_command
|
182
185
|
async def run(workflow,
|
@@ -303,7 +306,7 @@ async def run(workflow,
|
|
303
306
|
@click.option('--veryfy-source-code',
|
304
307
|
is_flag=True,
|
305
308
|
help='Veryfy the source code.')
|
306
|
-
@log_options
|
309
|
+
@log_options('maintain')
|
307
310
|
@command_option('maintain')
|
308
311
|
@async_command
|
309
312
|
async def maintain(workflow,
|
@@ -388,7 +391,7 @@ async def maintain(workflow,
|
|
388
391
|
@click.command()
|
389
392
|
@click.argument('report_id')
|
390
393
|
@click.option('--plot', '-p', is_flag=True, help='Plot the report.')
|
391
|
-
@log_options
|
394
|
+
@log_options('reproduce')
|
392
395
|
@command_option('reproduce')
|
393
396
|
@async_command
|
394
397
|
async def reproduce(report_id, code, data, api, plot):
|
@@ -415,16 +418,17 @@ async def reproduce(report_id, code, data, api, plot):
|
|
415
418
|
code = Path(os.path.expanduser(code))
|
416
419
|
data = Path(os.path.expanduser(data))
|
417
420
|
|
418
|
-
from . import transform
|
419
421
|
from .load import load_workflow_from_source_code
|
420
422
|
from .storage import get_report_by_index
|
421
423
|
|
424
|
+
reg = Registry()
|
425
|
+
|
422
426
|
r = get_report_by_index(int(report_id), data)
|
423
427
|
|
424
428
|
wf = load_workflow_from_source_code(r.workflow, r.script)
|
425
|
-
cfg =
|
426
|
-
|
427
|
-
|
429
|
+
cfg = reg.export()
|
430
|
+
reg.clear()
|
431
|
+
reg.update(r.config)
|
428
432
|
await run_workflow(wf, code, data, plot=plot, freeze=True)
|
429
|
-
|
430
|
-
|
433
|
+
reg.clear()
|
434
|
+
reg.update(cfg)
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import atexit
|
2
2
|
import inspect
|
3
|
-
import pickle
|
4
3
|
import os
|
5
|
-
import
|
4
|
+
import pickle
|
6
5
|
import shutil
|
7
6
|
import tempfile
|
7
|
+
import time
|
8
8
|
import warnings
|
9
9
|
from importlib.util import module_from_spec, spec_from_file_location
|
10
10
|
from pathlib import Path
|
@@ -13,6 +13,7 @@ from typing import Any
|
|
13
13
|
|
14
14
|
from loguru import logger
|
15
15
|
|
16
|
+
from .registry import Registry
|
16
17
|
from .storage import Report
|
17
18
|
from .template import (TemplateKeyError, TemplateTypeError, decode_mapping,
|
18
19
|
inject_mapping)
|
@@ -31,17 +32,16 @@ class SetConfigWorkflow():
|
|
31
32
|
return []
|
32
33
|
|
33
34
|
def check_state(self, history: Report) -> bool:
|
34
|
-
|
35
|
+
reg = Registry()
|
35
36
|
try:
|
36
|
-
return self._equal(history.parameters[self.key],
|
37
|
-
transform.query_config(self.key))
|
37
|
+
return self._equal(history.parameters[self.key], reg.get(self.key))
|
38
38
|
except:
|
39
39
|
return False
|
40
40
|
|
41
41
|
def calibrate(self):
|
42
|
-
|
42
|
+
reg = Registry()
|
43
43
|
try:
|
44
|
-
value =
|
44
|
+
value = reg.get(self.key)
|
45
45
|
except:
|
46
46
|
value = eval(input(f'"{self.key}": '))
|
47
47
|
return value
|
@@ -1,3 +1,9 @@
|
|
1
|
+
import importlib
|
2
|
+
import os
|
3
|
+
import sys
|
4
|
+
from typing import Any
|
5
|
+
|
6
|
+
from ..cli.config import get_config_value
|
1
7
|
from .storage import Report, save_item
|
2
8
|
|
3
9
|
__current_config_id = None
|
@@ -123,7 +129,7 @@ def set_config_api(query_method,
|
|
123
129
|
clear_method: The clear method.
|
124
130
|
the method should clear the config.
|
125
131
|
"""
|
126
|
-
global query_config, update_config, delete_config, export_config, clear_config
|
132
|
+
global query_config, update_config, delete_config, export_config, clear_config, _api
|
127
133
|
|
128
134
|
query_config = query_method
|
129
135
|
update_config = update_method
|
@@ -132,3 +138,48 @@ def set_config_api(query_method,
|
|
132
138
|
clear_config = clear_method
|
133
139
|
|
134
140
|
return query_config, update_config, delete_config, export_config, clear_config
|
141
|
+
|
142
|
+
|
143
|
+
def _init():
|
144
|
+
code = get_config_value("code", str, default=None)
|
145
|
+
if code is not None:
|
146
|
+
code = os.path.expanduser(code)
|
147
|
+
if code not in sys.path:
|
148
|
+
sys.path.insert(0, code)
|
149
|
+
|
150
|
+
api = get_config_value('api', str, None)
|
151
|
+
if api is not None:
|
152
|
+
api = importlib.import_module(api)
|
153
|
+
set_config_api(api.query_config, api.update_config, api.delete_config,
|
154
|
+
api.export_config, api.clear_config)
|
155
|
+
|
156
|
+
|
157
|
+
_init()
|
158
|
+
|
159
|
+
|
160
|
+
class Registry():
|
161
|
+
|
162
|
+
def __init__(self):
|
163
|
+
self.api = (query_config, update_config, delete_config, export_config,
|
164
|
+
clear_config)
|
165
|
+
|
166
|
+
def query(self, key: str) -> Any:
|
167
|
+
return self.api[0](key)
|
168
|
+
|
169
|
+
def get(self, key: str) -> Any:
|
170
|
+
return self.query(key)
|
171
|
+
|
172
|
+
def export(self) -> dict[str, dict[str, Any]]:
|
173
|
+
return self.api[3]()
|
174
|
+
|
175
|
+
def set(self, key: str, value: Any):
|
176
|
+
return self.api[1]({key: value})
|
177
|
+
|
178
|
+
def delete(self, key: str):
|
179
|
+
return self.api[2](key)
|
180
|
+
|
181
|
+
def clear(self):
|
182
|
+
return self.api[4]()
|
183
|
+
|
184
|
+
def update(self, parameters: dict[str, Any]):
|
185
|
+
return self.api[1](parameters)
|
@@ -8,9 +8,9 @@ from pathlib import Path
|
|
8
8
|
from loguru import logger
|
9
9
|
|
10
10
|
from .load import WorkflowType, get_dependents
|
11
|
+
from .registry import current_config, obey_the_oracle, update_parameters
|
11
12
|
from .storage import (Report, find_report, get_head, get_heads, renew_report,
|
12
13
|
revoke_report, save_item, save_report)
|
13
|
-
from .transform import current_config, obey_the_oracle, update_parameters
|
14
14
|
|
15
15
|
__session_id = None
|
16
16
|
__session_cache = {}
|
@@ -18,8 +18,8 @@ import dill
|
|
18
18
|
import numpy as np
|
19
19
|
import zmq
|
20
20
|
|
21
|
+
from ..expression import Env, Expression, Symbol
|
21
22
|
from ..sys.rpc.zmq_socket import ZMQContextManager
|
22
|
-
from .expression import Env, Expression, Symbol
|
23
23
|
from .optimize import NgOptimizer
|
24
24
|
from .record import Record
|
25
25
|
from .server import default_record_port
|
@@ -509,7 +509,8 @@ class Scan():
|
|
509
509
|
|
510
510
|
if self.config:
|
511
511
|
self.description['config'] = await create_config(
|
512
|
-
self._raw_config_copy, self.description['database'],
|
512
|
+
self._raw_config_copy, self.description['database'],
|
513
|
+
self._sock)
|
513
514
|
if current_notebook() is None:
|
514
515
|
await create_notebook('untitle', self.description['database'],
|
515
516
|
self._sock)
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "2.10.6"
|
qulab-2.10.4/qulab/version.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "2.10.4"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|