Skip to content

Commit 10a8a08

Browse files
committed
Simple path construction fixes
1 parent 79b3b3a commit 10a8a08

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/murfey/client/contexts/spa_metadata.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,12 @@ def post_transfer(
128128
source_visit_dir = source.parent
129129

130130
logger.info(
131-
f"Looking for atlas XML file in metadata directory {str((source_visit_dir / partial_path).parent)}"
131+
f"Looking for atlas XML file in metadata directory {str((source_visit_dir / environment.visit / partial_path).parent)}"
132132
)
133133
atlas_xml_path = list(
134-
(source_visit_dir / partial_path).parent.glob("Atlas_*.xml")
134+
(source_visit_dir / environment.visit / partial_path).parent.glob(
135+
"Atlas_*.xml"
136+
)
135137
)[0]
136138
logger.info(f"Atlas XML path {str(atlas_xml_path)} found")
137139
with open(atlas_xml_path, "rb") as atlas_xml:
@@ -190,7 +192,7 @@ def post_transfer(
190192
)
191193

192194
elif transferred_file.suffix == ".dm" and environment:
193-
gs_name = transferred_file.name.split("_")[1]
195+
gs_name = transferred_file.stem.split("_")[1]
194196
fh_positions = _foil_hole_positions(transferred_file, int(gs_name))
195197
source = _get_source(transferred_file, environment=environment)
196198
visitless_source = str(source).replace(f"/{environment.visit}", "")

0 commit comments

Comments
 (0)