Skip to content
Snippets Groups Projects
Commit e8bbf30d authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-604: fixed test. do not assume that all dataproducts have the 'sap'...

TMSS-604: fixed test. do not assume that all dataproducts have the 'sap' template. fixed copy/paste error for pipeline_idx field_idx/tab_idx
parent b2bd44d4
No related branches found
No related tags found
No related merge requests found
......@@ -145,7 +145,7 @@ def _convert_beamformer_settings_to_parset_dict(subtask: models.Subtask, spec: d
beamformer_pipeline_parsets = []
# Process beamformer pipelines
for pipeline in spec['COBALT']['beamformer']['tab_pipelines']:
for pipeline_idx, pipeline in enumerate(spec['COBALT']['beamformer']['tab_pipelines']):
pipeline_parset = {}
pipeline_parset.update(_add_prefix(_stokes_settings_parset_subkeys(pipeline['coherent']), "CoherentStokes."))
pipeline_parset.update(_add_prefix(_stokes_settings_parset_subkeys(pipeline['incoherent']), "IncoherentStokes."))
......@@ -176,12 +176,13 @@ def _convert_beamformer_settings_to_parset_dict(subtask: models.Subtask, spec: d
for s in range(nr_stokes):
for p in range(nr_parts):
dataproduct = [dp for dp in dataproducts
if dp.specifications_doc["sap"] == sap['name']
if dp.specifications_doc.get("sap") == sap['name']
and "identifiers" in dp.specifications_doc
and dp.specifications_doc["identifiers"]["pipeline_index"] == pipeline_idx
and dp.specifications_doc["identifiers"]["tab_index"] == field_idx
and dp.specifications_doc["identifiers"]["tab_index"] == tab_idx
and dp.specifications_doc["identifiers"]["stokes_index"] == s
and dp.specifications_doc["identifiers"]["part_index"] == p
and dp.specifications_doc["coherent"] == tab['coherent']]
and dp.specifications_doc.get("coherent") == tab['coherent']]
if tab['coherent']:
coherent_dataproducts.append(dataproduct[0] if dataproduct else null_dataproduct)
else:
......
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