Skip to content

Commit 280155b

Browse files
committed
If atlas not in visit, determine expected path
1 parent db351d1 commit 280155b

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/murfey/client/context.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,18 @@ def ensure_dcg_exists(
8989
if not windows_path:
9090
logger.warning("No atlas metadata path found")
9191
return None
92-
visit_index = windows_path.split("\\").index(environment.visit)
93-
partial_path = "/".join(windows_path.split("\\")[visit_index + 1 :])
94-
logger.info("Partial Linux path successfully constructed from Windows path")
92+
if environment.visit in windows_path.split("\\"):
93+
# Case of atlas in the correct location
94+
visit_index = windows_path.split("\\").index(environment.visit)
95+
partial_path = "/".join(windows_path.split("\\")[visit_index + 1 :])
96+
logger.info(
97+
f"Partial Linux path successfully constructed from Windows path: {partial_path}"
98+
)
99+
else:
100+
# Atlas not in visit, so come up with where it should have been
101+
# Assumes /structure/to/Supervisor/Sample/Atlas/Atlas.dm
102+
partial_path = "/".join(windows_path.split("\\")[-4:])
103+
logger.info(f"Partial Linux path estimated: {partial_path}")
95104

96105
logger.info(
97106
f"Looking for atlas XML file in metadata directory {str((source_visit_dir / partial_path).parent)}"

0 commit comments

Comments
 (0)