1717 MurfeyID ,
1818 MurfeyInstanceEnvironment ,
1919)
20- from murfey .server .api .file_manip import router as file_manip_router
21- from murfey .server .api .session_control import router as session_router
22- from murfey .server .api .workflow import router as workflow_router
23- from murfey .server .api .workflow import tomo_router as workflow_tomo_router
20+ from murfey .util .api import url_path_for
2421from murfey .util .client import (
2522 authorised_requests ,
2623 capture_post ,
@@ -113,7 +110,7 @@ def register_tomography_data_collections(
113110 )
114111 return
115112 try :
116- dcg_url = f"{ str (environment .url .geturl ())} { workflow_router . url_path_for ('register_dc_group' , visit_name = environment .visit , session_id = environment .murfey_session )} "
113+ dcg_url = f"{ str (environment .url .geturl ())} { url_path_for ('workflow.router' , 'register_dc_group' , visit_name = environment .visit , session_id = environment .murfey_session )} "
117114 dcg_data = {
118115 "experiment_type" : "tomo" ,
119116 "experiment_type_id" : 36 ,
@@ -125,7 +122,7 @@ def register_tomography_data_collections(
125122
126123 for tilt_series in self ._tilt_series .keys ():
127124 if tilt_series not in self ._tilt_series_with_pjids :
128- dc_url = f"{ str (environment .url .geturl ())} { workflow_router . url_path_for ('start_dc' , visit_name = environment .visit , session_id = environment .murfey_session )} "
125+ dc_url = f"{ str (environment .url .geturl ())} { url_path_for ('workflow.router' , 'start_dc' , visit_name = environment .visit , session_id = environment .murfey_session )} "
129126 dc_data = {
130127 "experiment_type" : "tomography" ,
131128 "file_extension" : file_extension ,
@@ -161,7 +158,7 @@ def register_tomography_data_collections(
161158 )
162159 capture_post (dc_url , json = dc_data )
163160
164- proc_url = f"{ str (environment .url .geturl ())} { workflow_router . url_path_for ('register_proc' , visit_name = environment .visit , session_id = environment .murfey_session )} "
161+ proc_url = f"{ str (environment .url .geturl ())} { url_path_for ('workflow.router' , 'register_proc' , visit_name = environment .visit , session_id = environment .murfey_session )} "
165162 for recipe in ("em-tomo-preprocess" , "em-tomo-align" ):
166163 capture_post (
167164 proc_url ,
@@ -266,7 +263,7 @@ def _add_tilt(
266263 f"Tilt series { tilt_series } was previously thought complete but now { file_path } has been seen"
267264 )
268265 self ._completed_tilt_series .remove (tilt_series )
269- rerun_url = f"{ str (environment .url .geturl ())} { workflow_tomo_router . url_path_for ('register_tilt_series_for_rerun' , visit_name = environment .visit )} "
266+ rerun_url = f"{ str (environment .url .geturl ())} { url_path_for ('workflow.tomo_router' , 'register_tilt_series_for_rerun' , visit_name = environment .visit )} "
270267 rerun_data = {
271268 "session_id" : environment .murfey_session ,
272269 "tag" : tilt_series ,
@@ -280,7 +277,7 @@ def _add_tilt(
280277 if not self ._tilt_series .get (tilt_series ):
281278 logger .info (f"New tilt series found: { tilt_series } " )
282279 self ._tilt_series [tilt_series ] = [file_path ]
283- ts_url = f"{ str (environment .url .geturl ())} { workflow_tomo_router . url_path_for ('register_tilt_series' , visit_name = environment .visit )} "
280+ ts_url = f"{ str (environment .url .geturl ())} { url_path_for ('workflow.tomo_router' , 'register_tilt_series' , visit_name = environment .visit )} "
284281 ts_data = {
285282 "session_id" : environment .murfey_session ,
286283 "tag" : tilt_series ,
@@ -309,7 +306,7 @@ def _add_tilt(
309306 self ._tilt_series [tilt_series ].append (file_path )
310307
311308 if environment :
312- tilt_url = f"{ str (environment .url .geturl ())} { workflow_tomo_router . url_path_for ('register_tilt' , visit_name = environment .visit , session_id = environment .murfey_session )} "
309+ tilt_url = f"{ str (environment .url .geturl ())} { url_path_for ('workflow.tomo_router' , 'register_tilt' , visit_name = environment .visit , session_id = environment .murfey_session )} "
313310 tilt_data = {
314311 "movie_path" : str (file_transferred_to ),
315312 "tilt_series_tag" : tilt_series ,
@@ -320,7 +317,7 @@ def _add_tilt(
320317 eer_fractionation_file = None
321318 if environment .data_collection_parameters .get ("num_eer_frames" ):
322319 response = requests .post (
323- f"{ str (environment .url .geturl ())} { file_manip_router . url_path_for ('write_eer_fractionation_file' , visit_name = environment .visit , session_id = environment .murfey_session )} " ,
320+ f"{ str (environment .url .geturl ())} { url_path_for ('file_manip.router' , 'write_eer_fractionation_file' , visit_name = environment .visit , session_id = environment .murfey_session )} " ,
324321 json = {
325322 "num_frames" : environment .data_collection_parameters [
326323 "num_eer_frames"
@@ -335,7 +332,7 @@ def _add_tilt(
335332 },
336333 )
337334 eer_fractionation_file = response .json ()["eer_fractionation_file" ]
338- preproc_url = f"{ str (environment .url .geturl ())} { workflow_tomo_router . url_path_for ('request_tomography_preprocessing' , visit_name = environment .visit , session_id = environment .murfey_session )} "
335+ preproc_url = f"{ str (environment .url .geturl ())} { url_path_for ('workflow.tomo_router' , 'request_tomography_preprocessing' , visit_name = environment .visit , session_id = environment .murfey_session )} "
339336 preproc_data = {
340337 "path" : str (file_transferred_to ),
341338 "description" : "" ,
@@ -495,7 +492,7 @@ def post_transfer(
495492
496493 # Always update the tilt series length in the database after an mdoc
497494 if environment .murfey_session is not None :
498- length_url = f"{ str (environment .url .geturl ())} { workflow_tomo_router . url_path_for ('register_tile_series_length' , session_id = environment .murfey_session )} "
495+ length_url = f"{ str (environment .url .geturl ())} { url_path_for ('workflow.tomo_router' , 'register_tile_series_length' , session_id = environment .murfey_session )} "
499496 capture_post (
500497 length_url ,
501498 json = {
@@ -512,7 +509,7 @@ def post_transfer(
512509 f"The following tilt series are considered complete: { completed_tilts } "
513510 f"after { transferred_file } "
514511 )
515- complete_url = f"{ str (environment .url .geturl ())} { workflow_tomo_router . url_path_for ('register_completed_tilt_series' , visit_name = environment .visit , session_id = environment .murfey_session )} "
512+ complete_url = f"{ str (environment .url .geturl ())} { url_path_for ('workflow.tomo_router' , 'register_completed_tilt_series' , visit_name = environment .visit , session_id = environment .murfey_session )} "
516513 capture_post (
517514 complete_url ,
518515 json = {
@@ -596,7 +593,7 @@ def gather_metadata(
596593 binning_factor = 1
597594 if environment :
598595 server_config = requests .get (
599- f"{ str (environment .url .geturl ())} { session_router . url_path_for ('machine_info_by_instrument' , instrument_name = environment .instrument_name )} "
596+ f"{ str (environment .url .geturl ())} { url_path_for ('session_control.router' , 'machine_info_by_instrument' , instrument_name = environment .instrument_name )} "
600597 ).json ()
601598 if (
602599 server_config .get ("superres" )
0 commit comments