88import xmltodict
99
1010from murfey .client .instance_environment import MurfeyInstanceEnvironment , SampleInfo
11- from murfey .util .client import capture_post , get_machine_config_client
11+ from murfey .util .client import capture_post
1212
1313logger = logging .getLogger ("murfey.client.context" )
1414
@@ -50,22 +50,19 @@ def _get_source(file_path: Path, environment: MurfeyInstanceEnvironment) -> Path
5050
5151
5252def _atlas_destination (
53- environment : MurfeyInstanceEnvironment , source : Path , token : str
53+ environment : MurfeyInstanceEnvironment ,
54+ source : Path ,
55+ rsync_basepath : Path ,
5456) -> Path :
55- machine_config = get_machine_config_client (
56- str (environment .url .geturl ()),
57- token ,
58- instrument_name = environment .instrument_name ,
59- )
6057 for i , destination_part in enumerate (
6158 Path (environment .default_destinations [source ]).parts
6259 ):
6360 if destination_part == environment .visit :
64- return Path ( machine_config . get ( " rsync_basepath" , "" )) / "/" .join (
61+ return rsync_basepath / "/" .join (
6562 Path (environment .default_destinations [source ]).parent .parts [: i + 1 ]
6663 )
6764 return (
68- Path ( machine_config . get ( " rsync_basepath" , "" ))
65+ rsync_basepath
6966 / Path (environment .default_destinations [source ]).parent
7067 / environment .visit
7168 )
@@ -75,6 +72,7 @@ def ensure_dcg_exists(
7572 collection_type : str ,
7673 metadata_source : Path ,
7774 environment : MurfeyInstanceEnvironment ,
75+ machine_config : dict ,
7876 token : str ,
7977) -> str | None :
8078 """Create a data collection group"""
@@ -181,7 +179,11 @@ def ensure_dcg_exists(
181179 "experiment_type_id" : experiment_type_id ,
182180 "tag" : dcg_tag ,
183181 "atlas" : str (
184- _atlas_destination (environment , session_file .parent , token )
182+ _atlas_destination (
183+ environment ,
184+ session_file .parent ,
185+ Path (machine_config .get ("rsync_basepath" , "" )),
186+ )
185187 / environment .samples [metadata_source ].atlas .parent
186188 / atlas_xml_path .with_suffix (".jpg" ).name
187189 ).replace ("//" , "/" ),
0 commit comments