Skip to content
Snippets Groups Projects
Commit a260b1c6 authored by Megan Henning's avatar Megan Henning
Browse files

Use copy of base analysis in loop

parent 1cfb846c
No related branches found
No related tags found
No related merge requests found
......@@ -147,10 +147,10 @@ def run(batch_job):
tags.append('batch')
if gear.get('category') == 'analysis':
analysis = proposal.get('analysis', {})
if not analysis.get('label'):
analysis_base = proposal.get('analysis', {})
if not analysis_base.get('label'):
time_now = datetime.datetime.utcnow()
analysis['label'] = {'label': '{} {}'.format(gear_name, time_now)}
analysis_base['label'] = {'label': '{} {}'.format(gear_name, time_now)}
an_storage = AnalysisStorage()
acq_storage = AcquisitionStorage()
......@@ -172,6 +172,8 @@ def run(batch_job):
if gear.get('category') == 'analysis':
analysis = copy.deepcopy(analysis_base)
# Create analysis
acquisition_id = inputs.values()[0].get('id')
session_id = acq_storage.get_container(acquisition_id, projection={'session':1}).get('session')
......@@ -195,6 +197,8 @@ def run(batch_job):
if gear.get('category') == 'analysis':
analysis = copy.deepcopy(analysis_base)
# Create analysis
result = an_storage.create_job_and_analysis('sessions', bson.ObjectId(dest['id']), analysis, job_map, origin, None)
job = result.get('job')
......
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