Skip to content

Commit 3b7ce70

Browse files
committed
Merge main and fix conflict
1 parent d790def commit 3b7ce70

File tree

12 files changed

+79
-60
lines changed

12 files changed

+79
-60
lines changed

.bumpclient.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.bumpversion]
2-
current_version = "0.20.2"
2+
current_version = "0.20.3"
33
commit = true
44
tag = false
55

.bumpversion.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.bumpversion]
2-
current_version = "0.20.2"
2+
current_version = "0.20.3"
33
commit = true
44
tag = true
55

Helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: murfey-services
33
description: Umbrella Helm chart for deploying the servers and daemons needed to enable Murfey to transfer and process data
4-
version: 0.20.2
4+
version: 0.20.3
55
dependencies:
66
- name: murfey-instrument-server-clem
77
- name: murfey-instrument-server-tem
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v1
22
name: murfey-instrument-server-clem
33
description: Helm chart for deploying a Murfey instrument server, which executes orders to detect, modify, and transfer files on the instrument PC, and notifies the backend server about transferred files
4-
version: 0.20.2
4+
version: 0.20.3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v1
22
name: murfey-instrument-server-tem
33
description: Helm chart for deploying a Murfey instrument server, which executes orders to detect, modify, and transfer files on the instrument PC, and notifies the backend server about transferred files
4-
version: 0.20.2
4+
version: 0.20.3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v1
22
name: murfey-rsync
33
description: Helm chart for deploying an rsync daemon, which is responsible for executing the transfer of files from the client storage directory to the server storage system
4-
version: 0.20.2
4+
version: 0.20.3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v1
22
name: murfey-server
33
description: Helm chart for deploying a Murfey backend server, which is responsible for orchestrating the data transfer and processing workflow between the client PC and the storage system
4-
version: 0.20.2
4+
version: 0.20.3

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ requires = [
77

88
[project]
99
name = "murfey"
10-
version = "0.20.2"
10+
version = "0.20.3"
1111
description = "Client-Server architecture hauling Cryo-EM data"
1212
readme = "README.md"
1313
keywords = [

src/murfey/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from __future__ import annotations
22

3-
__version__ = "0.20.2"
4-
__supported_client_version__ = "0.20.2"
3+
__version__ = "0.20.3"
4+
__supported_client_version__ = "0.20.3"

src/murfey/client/watchdir_multigrid.py

Lines changed: 66 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,55 @@ def stop(self):
5151
self.thread.join()
5252
log.debug("MultigridDirWatcher thread stop completed")
5353

54+
def _handle_metadata(self, directory: Path):
55+
self.notify(
56+
directory,
57+
extra_directory=f"metadata_{directory.name}",
58+
include_mid_path=False,
59+
analyse=self._analyse,
60+
limited=True,
61+
tag="metadata",
62+
)
63+
self._seen_dirs.append(directory)
64+
65+
def _handle_fractions(self, directory: Path, first_loop: bool):
66+
processing_started = False
67+
for d02 in directory.glob("Images-Disc*"):
68+
if d02 not in self._seen_dirs:
69+
# If 'skip_existing_processing' is set, do not process for
70+
# any data directories found on the first loop.
71+
# This allows you to avoid triggering processing again if Murfey is restarted
72+
self.notify(
73+
d02,
74+
include_mid_path=False,
75+
remove_files=True,
76+
analyse=(
77+
not (first_loop and self._skip_existing_processing)
78+
if self._analyse
79+
else False
80+
),
81+
tag="fractions",
82+
)
83+
self._seen_dirs.append(d02)
84+
processing_started = d02 in self._seen_dirs
85+
if not processing_started:
86+
if (
87+
directory.is_dir()
88+
and directory not in self._seen_dirs
89+
and list(directory.iterdir())
90+
):
91+
self.notify(
92+
directory,
93+
include_mid_path=False,
94+
analyse=(
95+
not (first_loop and self._skip_existing_processing)
96+
if self._analyse
97+
else False
98+
),
99+
tag="fractions",
100+
)
101+
self._seen_dirs.append(directory)
102+
54103
def _process(self):
55104
first_loop = True
56105
while not self._stopping:
@@ -75,53 +124,23 @@ def _process(self):
75124
)
76125
self._seen_dirs.append(d)
77126
else:
78-
if d.is_dir() and d not in self._seen_dirs:
79-
self.notify(
80-
d,
81-
extra_directory=f"metadata_{d.name}",
82-
include_mid_path=False,
83-
analyse=self._analyse,
84-
limited=True,
85-
tag="metadata",
86-
)
87-
self._seen_dirs.append(d)
88-
processing_started = False
89-
for d02 in (d.parent.parent / d.name).glob("Images-Disc*"):
90-
if d02 not in self._seen_dirs:
91-
# If 'skip_existing_processing' is set, do not process for
92-
# any data directories found on the first loop.
93-
# This allows you to avoid triggering processing again if Murfey is restarted
94-
self.notify(
95-
d02,
96-
include_mid_path=False,
97-
remove_files=True,
98-
analyse=(
99-
not (first_loop and self._skip_existing_processing)
100-
if self._analyse
101-
else False
102-
),
103-
tag="fractions",
104-
)
105-
self._seen_dirs.append(d02)
106-
processing_started = d02 in self._seen_dirs
107-
if not processing_started:
108-
d02 = d.parent.parent / d.name
109-
if (
110-
d02.is_dir()
111-
and d02 not in self._seen_dirs
112-
and list((d.parent.parent / d.name).iterdir())
113-
):
114-
self.notify(
115-
d02,
116-
include_mid_path=False,
117-
analyse=(
118-
not (first_loop and self._skip_existing_processing)
119-
if self._analyse
120-
else False
121-
),
122-
tag="fractions",
123-
)
124-
self._seen_dirs.append(d02)
127+
# hack for tomo multigrid metadata structure
128+
sample_dirs = list(d.glob("Sample*"))
129+
if d.is_dir() and len(sample_dirs):
130+
for sample in sample_dirs:
131+
if len(list(sample.glob("*.mdoc"))):
132+
if sample not in self._seen_dirs:
133+
self._handle_metadata(sample)
134+
self._handle_fractions(
135+
d.parent.parent.parent
136+
/ f"{d.parent.name}_{d.name}",
137+
first_loop,
138+
)
139+
140+
else:
141+
if d.is_dir() and d not in self._seen_dirs:
142+
self._handle_metadata(d)
143+
self._handle_fractions(d.parent.parent / d.name, first_loop)
125144

126145
if first_loop:
127146
first_loop = False

0 commit comments

Comments
 (0)