From dfeae6fbacc208f2f917fa8a47ec5c1880593cf2 Mon Sep 17 00:00:00 2001 From: yxd92326 Date: Tue, 9 Sep 2025 16:48:29 +0100 Subject: [PATCH 1/3] Should be sample not d --- src/murfey/client/watchdir_multigrid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/murfey/client/watchdir_multigrid.py b/src/murfey/client/watchdir_multigrid.py index 049c90835..c03ad004d 100644 --- a/src/murfey/client/watchdir_multigrid.py +++ b/src/murfey/client/watchdir_multigrid.py @@ -132,8 +132,8 @@ def _process(self): if sample not in self._seen_dirs: self._handle_metadata(sample) self._handle_fractions( - d.parent.parent.parent - / f"{d.parent.name}_{d.name}", + sample.parent.parent.parent + / f"{sample.parent.name}_{sample.name}", first_loop, ) From 051918b2d425935b2a692e9b065d46e8f0fff86a Mon Sep 17 00:00:00 2001 From: yxd92326 Date: Tue, 9 Sep 2025 17:03:45 +0100 Subject: [PATCH 2/3] Add Supervisor into metadata name for tomo-multi --- src/murfey/client/watchdir_multigrid.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/murfey/client/watchdir_multigrid.py b/src/murfey/client/watchdir_multigrid.py index c03ad004d..13aeeac6d 100644 --- a/src/murfey/client/watchdir_multigrid.py +++ b/src/murfey/client/watchdir_multigrid.py @@ -51,10 +51,10 @@ def stop(self): self.thread.join() log.debug("MultigridDirWatcher thread stop completed") - def _handle_metadata(self, directory: Path): + def _handle_metadata(self, directory: Path, extra_directory: str): self.notify( directory, - extra_directory=f"metadata_{directory.name}", + extra_directory=extra_directory, include_mid_path=False, analyse=self._analyse, limited=True, @@ -130,7 +130,10 @@ def _process(self): for sample in sample_dirs: if len(list(sample.glob("*.mdoc"))): if sample not in self._seen_dirs: - self._handle_metadata(sample) + self._handle_metadata( + sample, + extra_directory=f"metadata_{sample.parent.name}_{sample.name}", + ) self._handle_fractions( sample.parent.parent.parent / f"{sample.parent.name}_{sample.name}", @@ -139,7 +142,9 @@ def _process(self): else: if d.is_dir() and d not in self._seen_dirs: - self._handle_metadata(d) + self._handle_metadata( + d, extra_directory=f"metadata_{d.name}" + ) self._handle_fractions(d.parent.parent / d.name, first_loop) if first_loop: From b6386e43d88dc26f09fefda4c8b7b38eb0967ed7 Mon Sep 17 00:00:00 2001 From: yxd92326 Date: Tue, 9 Sep 2025 17:12:35 +0100 Subject: [PATCH 3/3] Match the metadata and fractions in destination registry --- src/murfey/client/destinations.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/murfey/client/destinations.py b/src/murfey/client/destinations.py index bae70ce12..dd9dbb716 100644 --- a/src/murfey/client/destinations.py +++ b/src/murfey/client/destinations.py @@ -47,11 +47,12 @@ def determine_default_destination( mid_path = source.absolute().relative_to(Path(data_dir).absolute()) if use_suggested_path: with global_env_lock: - source_name = ( - source.name - if source.name != "Images-Disc1" - else source.parent.name - ) + if source.name == "Images-Disc1": + source_name = source.parent.name + elif source.name.startswith("Sample"): + source_name = f"{source.parent.name}_{source.name}" + else: + source_name = source.name if environment.destination_registry.get(source_name): _default = environment.destination_registry[source_name] else: