Skip to content
Snippets Groups Projects
Commit 01278d3c authored by Philipp Schmidt's avatar Philipp Schmidt
Browse files

Merge branch 'fix/disable-correct-passing' into 'master'

Pop internal disable-correct key from data mapping

See merge request detectors/pycalibration!629
parents 7ffeac53 f4623fa3
No related branches found
No related tags found
1 merge request!629Pop internal disable-correct key from data mapping
...@@ -950,11 +950,6 @@ class ActionsServer: ...@@ -950,11 +950,6 @@ class ActionsServer:
for karabo_id in pconf: for karabo_id in pconf:
dconfig = data_conf[karabo_id] dconfig = data_conf[karabo_id]
if dconfig.get('disable-correct', False):
# Skip this detector installation for
# corrections if disabled.
continue
# check for files according to mapping in raw run dir. # check for files according to mapping in raw run dir.
if any(y in x for x in fl if any(y in x for x in fl
for y in dconfig['karabo-da']): for y in dconfig['karabo-da']):
...@@ -974,6 +969,13 @@ class ActionsServer: ...@@ -974,6 +969,13 @@ class ActionsServer:
Errors.REQUEST_FAILED) Errors.REQUEST_FAILED)
return return
for karabo_id in list(detectors.keys()):
# Check for any detectors for which corrections are
# disabled manually.
if detectors[karabo_id].pop('disable-correct', False):
logging.warning(f'Skipping disabled detector {karabo_id}')
del detectors[karabo_id]
if len(detectors) == 0: if len(detectors) == 0:
msg = Errors.NOTHING_TO_DO.format(rpath) msg = Errors.NOTHING_TO_DO.format(rpath)
logging.warning(msg) logging.warning(msg)
...@@ -1076,6 +1078,9 @@ class ActionsServer: ...@@ -1076,6 +1078,9 @@ class ActionsServer:
triple = any(det in karabo_id for det in triple = any(det in karabo_id for det in
["LPD", "AGIPD", "JUNGFRAU", "JF", "JNGFR"]) ["LPD", "AGIPD", "JUNGFRAU", "JF", "JNGFR"])
# This fails silently if the hardcoded strings above are
# ever changed (triple = False) but the underlying notebook
# still expects run-high/run-med/run-low.
if triple and len(runs) == 1: if triple and len(runs) == 1:
runs_dict = {'run-high': runs[0], runs_dict = {'run-high': runs[0],
'run-med': '0', 'run-med': '0',
...@@ -1091,6 +1096,9 @@ class ActionsServer: ...@@ -1091,6 +1096,9 @@ class ActionsServer:
# is not migrated, thus skipping some validation here. # is not migrated, thus skipping some validation here.
thisconf = copy.copy(data_conf[karabo_id]) thisconf = copy.copy(data_conf[karabo_id])
# Pop internal key to avoid propagation to xfel-calibrate.
thisconf.pop('disable-correct', None)
if (karabo_id in pconf if (karabo_id in pconf
and isinstance(pconf[karabo_id], dict)): and isinstance(pconf[karabo_id], dict)):
thisconf.update(copy.copy(pconf[karabo_id])) thisconf.update(copy.copy(pconf[karabo_id]))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment