From 280155b92c4d6da2129fe75046c92bcb0db106c7 Mon Sep 17 00:00:00 2001 From: yxd92326 Date: Fri, 13 Feb 2026 09:18:39 +0000 Subject: [PATCH 1/3] If atlas not in visit, determine expected path --- src/murfey/client/context.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/murfey/client/context.py b/src/murfey/client/context.py index f17398909..d7abc2ffa 100644 --- a/src/murfey/client/context.py +++ b/src/murfey/client/context.py @@ -89,9 +89,18 @@ def ensure_dcg_exists( if not windows_path: logger.warning("No atlas metadata path found") return None - visit_index = windows_path.split("\\").index(environment.visit) - partial_path = "/".join(windows_path.split("\\")[visit_index + 1 :]) - logger.info("Partial Linux path successfully constructed from Windows path") + if environment.visit in windows_path.split("\\"): + # Case of atlas in the correct location + visit_index = windows_path.split("\\").index(environment.visit) + partial_path = "/".join(windows_path.split("\\")[visit_index + 1 :]) + logger.info( + f"Partial Linux path successfully constructed from Windows path: {partial_path}" + ) + else: + # Atlas not in visit, so come up with where it should have been + # Assumes /structure/to/Supervisor/Sample/Atlas/Atlas.dm + partial_path = "/".join(windows_path.split("\\")[-4:]) + logger.info(f"Partial Linux path estimated: {partial_path}") logger.info( f"Looking for atlas XML file in metadata directory {str((source_visit_dir / partial_path).parent)}" From cc72af3fdf5a10984d4c8661d8881fba9aa70347 Mon Sep 17 00:00:00 2001 From: yxd92326 Date: Fri, 13 Feb 2026 09:25:28 +0000 Subject: [PATCH 2/3] Do not crash analyser if dcg fails --- src/murfey/client/multigrid_control.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/murfey/client/multigrid_control.py b/src/murfey/client/multigrid_control.py index bfe4372ae..173e49273 100644 --- a/src/murfey/client/multigrid_control.py +++ b/src/murfey/client/multigrid_control.py @@ -566,12 +566,15 @@ def _start_dc(self, metadata_json): + "/".join(source.parts[-2:]) ) metadata_source = Path(metadata_source_as_str.replace("//", "/")) - ensure_dcg_exists( - collection_type="spa", - metadata_source=metadata_source, - environment=self._environment, - token=self.token, - ) + try: + ensure_dcg_exists( + collection_type="spa", + metadata_source=metadata_source, + environment=self._environment, + token=self.token, + ) + except Exception as e: + log.error(f"Failed to register data collection group: {e}") data = { "voltage": metadata_json["voltage"], "pixel_size_on_image": metadata_json["pixel_size_on_image"], From cd160d091f1e026f4740c7d2b7b9630eb0033a2c Mon Sep 17 00:00:00 2001 From: yxd92326 Date: Mon, 16 Feb 2026 13:48:23 +0000 Subject: [PATCH 3/3] Assemble expected path with atlas at the start --- src/murfey/client/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/murfey/client/context.py b/src/murfey/client/context.py index d7abc2ffa..3be79cd77 100644 --- a/src/murfey/client/context.py +++ b/src/murfey/client/context.py @@ -99,7 +99,7 @@ def ensure_dcg_exists( else: # Atlas not in visit, so come up with where it should have been # Assumes /structure/to/Supervisor/Sample/Atlas/Atlas.dm - partial_path = "/".join(windows_path.split("\\")[-4:]) + partial_path = "atlas/" + "/".join(windows_path.split("\\")[-4:]) logger.info(f"Partial Linux path estimated: {partial_path}") logger.info(