From 26f5bbb12a087bcf87ca117337af974f6aea1363 Mon Sep 17 00:00:00 2001 From: Daniel Hatton Date: Mon, 13 Jan 2025 10:59:00 +0000 Subject: [PATCH 1/4] Fix recipe lookup in SPA flush --- src/murfey/server/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/murfey/server/__init__.py b/src/murfey/server/__init__.py index 335525851..cd39898ca 100644 --- a/src/murfey/server/__init__.py +++ b/src/murfey/server/__init__.py @@ -1959,7 +1959,10 @@ def _flush_spa_preprocessing(message: dict): .where(db.DataCollection.dcg_id == db.DataCollectionGroup.id) .where(db.ProcessingJob.dc_id == db.DataCollection.id) .where(db.AutoProcProgram.pj_id == db.ProcessingJob.id) - .where(db.ProcessingJob.recipe == "em-spa-preprocess") + .where( + db.ProcessingJob.recipe + == machine_config.recipes.get("em-spa-preprocess", "em-spa-preprocess") + ) ).one() params = murfey_db.exec( select(db.SPARelionParameters, db.SPAFeedbackParameters) @@ -2089,7 +2092,10 @@ def _flush_tomography_preprocessing(message: dict): .where(db.DataCollection.tag == f.tag) .where(db.ProcessingJob.dc_id == db.DataCollection.id) .where(db.AutoProcProgram.pj_id == db.ProcessingJob.id) - .where(db.ProcessingJob.recipe == "em-tomo-preprocess") + .where( + db.ProcessingJob.recipe + == machine_config.get("em-tomo-preprocess", "em-tomo-preprocess") + ) ).one() detached_ids = [c.id for c in collected_ids] From 10510938c06e15c2a0a396e76191d71fec4d2307 Mon Sep 17 00:00:00 2001 From: Daniel Hatton Date: Mon, 13 Jan 2025 11:01:20 +0000 Subject: [PATCH 2/4] Add foil hole ID to preprocessing request sent when flushing SPA --- src/murfey/server/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/murfey/server/__init__.py b/src/murfey/server/__init__.py index cd39898ca..935a63f39 100644 --- a/src/murfey/server/__init__.py +++ b/src/murfey/server/__init__.py @@ -2023,6 +2023,7 @@ def _flush_spa_preprocessing(message: dict): "particle_diameter": proc_params.particle_diameter or 0, "fm_int_file": f.eer_fractionation_file, "do_icebreaker_jobs": default_spa_parameters.do_icebreaker_jobs, + "foil_hole_id": f.foil_hole_id, }, } if _transport_object: From a3f68d698c91020c2b82584a35b223aa7d5b67e0 Mon Sep 17 00:00:00 2001 From: Daniel Hatton Date: Mon, 13 Jan 2025 11:04:50 +0000 Subject: [PATCH 3/4] Missed a few places the where the recipe needs generalising --- src/murfey/server/__init__.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/murfey/server/__init__.py b/src/murfey/server/__init__.py index 935a63f39..b2000d5b0 100644 --- a/src/murfey/server/__init__.py +++ b/src/murfey/server/__init__.py @@ -1947,6 +1947,7 @@ def _flush_spa_preprocessing(message: dict): machine_config = get_machine_config(instrument_name=instrument_name)[ instrument_name ] + recipe_name = machine_config.recipes.get("em-spa-preprocess", "em-spa-preprocess") collected_ids = murfey_db.exec( select( db.DataCollectionGroup, @@ -1959,10 +1960,7 @@ def _flush_spa_preprocessing(message: dict): .where(db.DataCollection.dcg_id == db.DataCollectionGroup.id) .where(db.ProcessingJob.dc_id == db.DataCollection.id) .where(db.AutoProcProgram.pj_id == db.ProcessingJob.id) - .where( - db.ProcessingJob.recipe - == machine_config.recipes.get("em-spa-preprocess", "em-spa-preprocess") - ) + .where(db.ProcessingJob.recipe == recipe_name) ).one() params = murfey_db.exec( select(db.SPARelionParameters, db.SPAFeedbackParameters) @@ -2003,7 +2001,7 @@ def _flush_spa_preprocessing(message: dict): ) murfey_db.add(movie) zocalo_message: dict = { - "recipes": ["em-spa-preprocess"], + "recipes": [recipe_name], "parameters": { "node_creator_queue": machine_config.node_creator_queue, "dcid": collected_ids[1].id, @@ -2079,6 +2077,8 @@ def _flush_tomography_preprocessing(message: dict): ) return + recipe_name = machine_config.get("em-tomo-preprocess", "em-tomo-preprocess") + for f in stashed_files: collected_ids = murfey_db.exec( select( @@ -2093,10 +2093,7 @@ def _flush_tomography_preprocessing(message: dict): .where(db.DataCollection.tag == f.tag) .where(db.ProcessingJob.dc_id == db.DataCollection.id) .where(db.AutoProcProgram.pj_id == db.ProcessingJob.id) - .where( - db.ProcessingJob.recipe - == machine_config.get("em-tomo-preprocess", "em-tomo-preprocess") - ) + .where(db.ProcessingJob.recipe == recipe_name) ).one() detached_ids = [c.id for c in collected_ids] @@ -2112,7 +2109,7 @@ def _flush_tomography_preprocessing(message: dict): ) murfey_db.add(movie) zocalo_message: dict = { - "recipes": ["em-tomo-preprocess"], + "recipes": [recipe_name], "parameters": { "node_creator_queue": machine_config.node_creator_queue, "dcid": detached_ids[1], From bf7a57a3de84d1cccb258084215fc6870daa7ebc Mon Sep 17 00:00:00 2001 From: Daniel Hatton Date: Mon, 13 Jan 2025 11:07:31 +0000 Subject: [PATCH 4/4] Typo fix --- src/murfey/server/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/murfey/server/__init__.py b/src/murfey/server/__init__.py index b2000d5b0..823df3063 100644 --- a/src/murfey/server/__init__.py +++ b/src/murfey/server/__init__.py @@ -1974,7 +1974,7 @@ def _flush_spa_preprocessing(message: dict): f"No SPA processing parameters found for client processing job ID {collected_ids[2].id}" ) raise ValueError( - "No processing parameters were foudn in the database when flushing SPA preprocessing" + "No processing parameters were found in the database when flushing SPA preprocessing" ) murfey_ids = _murfey_id(