QuLab 2.6.1__cp312-cp312-macosx_10_13_universal2.whl → 2.6.2__cp312-cp312-macosx_10_13_universal2.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: QuLab
3
- Version: 2.6.1
3
+ Version: 2.6.2
4
4
  Summary: contral instruments and manage data
5
5
  Author-email: feihoo87 <feihoo87@gmail.com>
6
6
  Maintainer-email: feihoo87 <feihoo87@gmail.com>
@@ -1,14 +1,14 @@
1
1
  qulab/__init__.py,sha256=tKRZe2WafDGcwbu7ddlMaePerN842aRbxcrECsu5pas,286
2
2
  qulab/__main__.py,sha256=fjaRSL_uUjNIzBGNgjlGswb9TJ2VD5qnkZHW3hItrD4,68
3
3
  qulab/dicttree.py,sha256=tRRMpGZYVOLw0TEByE3_2Ss8FdOmzuGL9e1DWbs8qoY,13684
4
- qulab/fun.cpython-312-darwin.so,sha256=A0l5Gnwe4GSKgijWzaoILHCqBeYuw_XYwd061uuYY3E,126864
4
+ qulab/fun.cpython-312-darwin.so,sha256=9N82f5OtiXpzAUcnR_CUckwGPIrkpTisYYAL17zH9QI,126864
5
5
  qulab/typing.py,sha256=5xCLfrp1aZpKpDy4p2arbFszw2eK3hGUjZa-XSvC_-8,69
6
- qulab/version.py,sha256=CxIX_WubB9c4uEWgzV2lPv0dBsuUamxzVZLp62HT2u4,21
6
+ qulab/version.py,sha256=sQMuYaw_409lWyUHUBi5qsAZncFg7IE4n-dlpxOTlds,21
7
7
  qulab/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  qulab/cli/commands.py,sha256=tgDIkkeIoasQXAifJZ6NU8jDgpNgb2a-B0C4nF0evrE,559
9
9
  qulab/cli/config.py,sha256=SdNmWzweWAdyk8M2oKYhMxnkaJ0qIayPlsLGCNlVqME,3108
10
10
  qulab/executor/__init__.py,sha256=LosPzOMaljSZY1thy_Fxtbrgq7uubJszMABEB7oM7tU,101
11
- qulab/executor/cli.py,sha256=MjwXe_ZEolVzNkGYq6G4cp-iHI0TiAlNkSuX2p0ZZQk,6760
11
+ qulab/executor/cli.py,sha256=gQ7kYrppxxCWtyhTRs2kUq916P1zUb6JTqBglDqU80s,7943
12
12
  qulab/executor/load.py,sha256=_XxHHSgQTxaOo6zhY9UZnqPu_wiG8BT6FyBaeH67lvo,17856
13
13
  qulab/executor/schedule.py,sha256=RkhDjwsxXT2RmO6ZTcP7LGsY4M4KY6Acmykq_kQ_wcc,13992
14
14
  qulab/executor/storage.py,sha256=2Kvv7Nk98OLF6ux2PkfTTcZnHDG3g6TKpIb9e7yVbz0,8694
@@ -93,9 +93,9 @@ qulab/visualization/plot_seq.py,sha256=UWTS6p9nfX_7B8ehcYo6UnSTUCjkBsNU9jiOeW2ca
93
93
  qulab/visualization/qdat.py,sha256=ZeevBYWkzbww4xZnsjHhw7wRorJCBzbG0iEu-XQB4EA,5735
94
94
  qulab/visualization/rot3d.py,sha256=lMrEJlRLwYe6NMBlGkKYpp_V9CTipOAuDy6QW_cQK00,734
95
95
  qulab/visualization/widgets.py,sha256=6KkiTyQ8J-ei70LbPQZAK35wjktY47w2IveOa682ftA,3180
96
- QuLab-2.6.1.dist-info/LICENSE,sha256=PRzIKxZtpQcH7whTG6Egvzl1A0BvnSf30tmR2X2KrpA,1065
97
- QuLab-2.6.1.dist-info/METADATA,sha256=cccOr38VtvBcqweogYFASdwU5zRzc5YcEmq1HnK6Qh4,3698
98
- QuLab-2.6.1.dist-info/WHEEL,sha256=iDXcyuxg-66TzzqHGH-kgw_HJdaJE_1RHznrvPNCSNs,115
99
- QuLab-2.6.1.dist-info/entry_points.txt,sha256=b0v1GXOwmxY-nCCsPN_rHZZvY9CtTbWqrGj8u1m8yHo,45
100
- QuLab-2.6.1.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
101
- QuLab-2.6.1.dist-info/RECORD,,
96
+ QuLab-2.6.2.dist-info/LICENSE,sha256=PRzIKxZtpQcH7whTG6Egvzl1A0BvnSf30tmR2X2KrpA,1065
97
+ QuLab-2.6.2.dist-info/METADATA,sha256=Mr5Cg21YMmIhvJpqyBTLHIxmk_9-ngrrGRGvpUqbx9M,3698
98
+ QuLab-2.6.2.dist-info/WHEEL,sha256=iDXcyuxg-66TzzqHGH-kgw_HJdaJE_1RHznrvPNCSNs,115
99
+ QuLab-2.6.2.dist-info/entry_points.txt,sha256=b0v1GXOwmxY-nCCsPN_rHZZvY9CtTbWqrGj8u1m8yHo,45
100
+ QuLab-2.6.2.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
101
+ QuLab-2.6.2.dist-info/RECORD,,
qulab/executor/cli.py CHANGED
@@ -12,6 +12,7 @@ from .load import (WorkflowType, find_unreferenced_workflows, get_entries,
12
12
  load_workflow, make_graph)
13
13
  from .schedule import maintain as maintain_workflow
14
14
  from .schedule import run as run_workflow
15
+ from .schedule import CalibrationFailedError
15
16
  from .transform import set_config_api
16
17
  from .utils import workflow_template
17
18
 
@@ -135,16 +136,20 @@ def get(key, api):
135
136
  '-n',
136
137
  is_flag=True,
137
138
  help='Do not run dependents.')
139
+ @click.option('--retry', '-r', default=1, type=int, help='Retry times.')
138
140
  @click.option('--update', '-u', is_flag=True)
139
141
  @log_options
140
142
  @command_option('run')
141
- def run(workflow, code, data, api, plot, no_dependents, update):
143
+ def run(workflow, code, data, api, plot, no_dependents, retry, update):
142
144
  """
143
145
  Run a workflow.
144
146
  """
145
147
  logger.info(
146
- f'[CMD]: run {workflow} --code {code} --data {data} --api {api}{" --plot" if plot else ""}{" --no-dependents" if no_dependents else ""}{" --update " if update else ""}'
147
- )
148
+ f'[CMD]: run {workflow} --code {code} --data {data} --api {api}'
149
+ f'{" --plot" if plot else ""}'
150
+ f'{" --no-dependents" if no_dependents else ""}'
151
+ f' --retry {retry}'
152
+ f'{" --update " if update else ""}')
148
153
  if api is not None:
149
154
  api = importlib.import_module(api)
150
155
  set_config_api(api.query_config, api.update_config, api.export_config)
@@ -159,42 +164,56 @@ def run(workflow, code, data, api, plot, no_dependents, update):
159
164
  wf = load_workflow(workflow, code)
160
165
  check_toplogy(wf, code)
161
166
 
162
- if no_dependents:
163
- if hasattr(wf, 'entries'):
164
- for entry in get_entries(wf, code):
165
- run_workflow(entry, code, data, plot=plot, update=update)
166
- else:
167
- run_workflow(wf, code, data, plot=plot, update=update)
168
- else:
169
- if hasattr(wf, 'entries'):
170
- for entry in get_entries(wf, code):
171
- maintain_workflow(entry,
172
- code,
173
- data,
174
- run=True,
175
- plot=plot,
176
- update=update)
177
- else:
178
- maintain_workflow(wf,
179
- code,
180
- data,
181
- run=True,
182
- plot=plot,
183
- update=update)
167
+ for i in range(retry):
168
+ try:
169
+ if no_dependents:
170
+ if hasattr(wf, 'entries'):
171
+ for entry in get_entries(wf, code):
172
+ run_workflow(entry,
173
+ code,
174
+ data,
175
+ plot=plot,
176
+ update=update)
177
+ else:
178
+ run_workflow(wf, code, data, plot=plot, update=update)
179
+ else:
180
+ if hasattr(wf, 'entries'):
181
+ for entry in get_entries(wf, code):
182
+ maintain_workflow(entry,
183
+ code,
184
+ data,
185
+ run=True,
186
+ plot=plot,
187
+ update=update)
188
+ else:
189
+ maintain_workflow(wf,
190
+ code,
191
+ data,
192
+ run=True,
193
+ plot=plot,
194
+ update=update)
195
+ break
196
+ except CalibrationFailedError as e:
197
+ if i == retry - 1:
198
+ raise e
199
+ logger.warning(f'Calibration failed, retrying ({i + 1}/{retry})')
200
+ continue
184
201
 
185
202
 
186
203
  @click.command()
187
204
  @click.argument('workflow')
205
+ @click.option('--retry', '-r', default=1, type=int, help='Retry times.')
188
206
  @click.option('--plot', '-p', is_flag=True, help='Plot the result.')
189
207
  @log_options
190
208
  @command_option('maintain')
191
- def maintain(workflow, code, data, api, plot):
209
+ def maintain(workflow, code, data, api, retry, plot):
192
210
  """
193
211
  Maintain a workflow.
194
212
  """
195
213
  logger.info(
196
- f'[CMD]: maintain {workflow} --code {code} --data {data} --api {api}{" --plot" if plot else ""}'
197
- )
214
+ f'[CMD]: maintain {workflow} --code {code} --data {data} --api {api}'
215
+ f' --retry {retry}'
216
+ f'{" --plot" if plot else ""}')
198
217
  if api is not None:
199
218
  api = importlib.import_module(api)
200
219
  set_config_api(api.query_config, api.update_config, api.export_config)
@@ -209,8 +228,15 @@ def maintain(workflow, code, data, api, plot):
209
228
  wf = load_workflow(workflow, code)
210
229
  check_toplogy(wf, code)
211
230
 
212
- if hasattr(wf, 'entries'):
213
- for entry in get_entries(wf, code):
214
- maintain_workflow(entry, code, data, run=False, plot=plot)
215
- else:
216
- maintain_workflow(wf, code, data, run=False, plot=plot)
231
+ for i in range(retry):
232
+ try:
233
+ if hasattr(wf, 'entries'):
234
+ for entry in get_entries(wf, code):
235
+ maintain_workflow(entry, code, data, run=False, plot=plot)
236
+ else:
237
+ maintain_workflow(wf, code, data, run=False, plot=plot)
238
+ except CalibrationFailedError as e:
239
+ if i == retry - 1:
240
+ raise e
241
+ logger.warning(f'Calibration failed, retrying ({i + 1}/{retry})')
242
+ continue
Binary file
qulab/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.6.1"
1
+ __version__ = "2.6.2"
File without changes
File without changes