11from logging import getLogger
2+ from typing import Tuple
23
34import numpy as np
45from sqlalchemy import func
2122logger = getLogger ("murfey.workflows.tomo.feedback" )
2223
2324
24- def _pj_id_tomo_classification (app_id : int , recipe : str , _db ) -> int :
25+ def _ids_tomo_classification (app_id : int , recipe : str , _db ) -> Tuple [ int , int ] :
2526 dcg_id = (
2627 _db .exec (
2728 select (AutoProcProgram , ProcessingJob , DataCollection )
@@ -42,13 +43,15 @@ def _pj_id_tomo_classification(app_id: int, recipe: str, _db) -> int:
4243 .one ()[0 ]
4344 .id
4445 )
45- return pj_id
46+ return dcg_id , pj_id
4647
4748
4849def _register_picked_tomogram_use_diameter (message : dict , _db : Session ):
4950 """Received picked particles from the tomogram autopick service"""
5051 # Add this message to the table of seen messages
51- pj_id = _pj_id_tomo_classification (message ["program_id" ], "em-tomo-class2d" , _db )
52+ dcg_id , pj_id = _ids_tomo_classification (
53+ message ["program_id" ], "em-tomo-class2d" , _db
54+ )
5255
5356 pick_params = TomogramPicks (
5457 pj_id = pj_id ,
@@ -78,7 +81,7 @@ def _register_picked_tomogram_use_diameter(message: dict, _db: Session):
7881 ]
7982 tomo_params = _db .exec (
8083 select (TomographyProcessingParameters ).where (
81- TomographyProcessingParameters .pj_id == pj_id
84+ TomographyProcessingParameters .dcg_id == dcg_id
8285 )
8386 ).one ()
8487
0 commit comments