Skip to content

Commit 1167df7

Browse files
committed
Method to enter tomo metadata context
1 parent 405d259 commit 1167df7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/murfey/client/analyser.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from murfey.client.contexts.spa import SPAModularContext
2020
from murfey.client.contexts.spa_metadata import SPAMetadataContext
2121
from murfey.client.contexts.tomo import TomographyContext
22+
from murfey.client.contexts.tomo_metadata import TomographyMetadataContext
2223
from murfey.client.instance_environment import MurfeyInstanceEnvironment
2324
from murfey.client.rsync import RSyncerUpdate, TransferResult
2425
from murfey.util.client import Observer, get_machine_config_client
@@ -226,6 +227,13 @@ def _analyse(self):
226227
and not self._context
227228
):
228229
self._context = SPAMetadataContext("epu", self._basepath)
230+
elif (
231+
"Batch" in transferred_file.parts
232+
or "SearchMap" in transferred_file.parts
233+
or transferred_file.name == "Session.dm"
234+
and not self._context
235+
):
236+
self._context = TomographyMetadataContext("tomo", self._basepath)
229237
self.post_transfer(transferred_file)
230238
else:
231239
dc_metadata = {}
@@ -369,9 +377,10 @@ def _analyse(self):
369377
elif isinstance(
370378
self._context,
371379
(
372-
TomographyContext,
373380
SPAModularContext,
374381
SPAMetadataContext,
382+
TomographyContext,
383+
TomographyMetadataContext,
375384
),
376385
):
377386
context = str(self._context).split(" ")[0].split(".")[-1]

src/murfey/client/contexts/tomo_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def post_transfer(
5050
**kwargs,
5151
)
5252

53-
if transferred_file.name == "Session.xml" and environment:
53+
if transferred_file.name == "Session.dm" and environment:
5454
logger.info("Tomography session metadata found")
5555
with open(transferred_file, "r") as session_xml:
5656
session_data = xmltodict.parse(session_xml.read())

0 commit comments

Comments
 (0)