Skip to content

Commit 32205ba

Browse files
committed
Send cryolo model when flushing spa
1 parent 2d3e030 commit 32205ba

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/murfey/workflows/spa/flush_spa_preprocess.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from murfey.server import _transport_object
1010
from murfey.server.api.auth import MurfeySessionID
11+
from murfey.server.api.spa import _cryolo_model_path
1112
from murfey.server.feedback import _murfey_id
1213
from murfey.util import sanitise, secure_path
1314
from murfey.util.config import get_machine_config, get_microscope
@@ -314,15 +315,12 @@ def flush_spa_preprocess(message: dict, murfey_db: Session, demo: bool = False)
314315
).all()
315316
if not stashed_files:
316317
return True
317-
instrument_name = (
318-
murfey_db.exec(
319-
select(MurfeySession).where(MurfeySession.id == message["session_id"])
320-
)
321-
.one()
322-
.instrument_name
323-
)
324-
machine_config = get_machine_config(instrument_name=instrument_name)[
325-
instrument_name
318+
319+
murfey_session = murfey_db.exec(
320+
select(MurfeySession).where(MurfeySession.id == message["session_id"])
321+
).one()
322+
machine_config = get_machine_config(instrument_name=murfey_session.instrument_name)[
323+
murfey_session.instrument_name
326324
]
327325
recipe_name = machine_config.recipes.get("em-spa-preprocess", "em-spa-preprocess")
328326
collected_ids = murfey_db.exec(
@@ -424,6 +422,11 @@ def flush_spa_preprocess(message: dict, murfey_db: Session, demo: bool = False)
424422
else f.eer_fractionation_file
425423
),
426424
"do_icebreaker_jobs": default_spa_parameters.do_icebreaker_jobs,
425+
"cryolo_model_weights": str(
426+
_cryolo_model_path(
427+
murfey_session.visit, murfey_session.instrument_name
428+
)
429+
),
427430
"foil_hole_id": foil_hole_id,
428431
},
429432
}

0 commit comments

Comments
 (0)