Skip to content

Commit d63b6da

Browse files
committed
Consistency between tomo and spa path construction
1 parent f819f4c commit d63b6da

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/murfey/server/api/workflow.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,14 @@ async def request_tomography_preprocessing(
643643
machine_config = get_machine_config(instrument_name=instrument_name)[
644644
instrument_name
645645
]
646-
visit_idx = Path(proc_file.path).parts.index(visit_name)
647-
core = Path(*Path(proc_file.path).parts[: visit_idx + 1])
648-
ppath = Path("/".join(secure_filename(p) for p in Path(proc_file.path).parts))
649-
sub_dataset = "/".join(ppath.relative_to(core).parts[:-1])
646+
parts = [secure_filename(p) for p in Path(proc_file.path).parts]
647+
visit_idx = parts.index(visit_name)
648+
core = Path("/") / Path(*parts[: visit_idx + 1])
649+
ppath = Path("/") / Path(*parts)
650+
if machine_config.process_multiple_datasets:
651+
sub_dataset = ppath.relative_to(core).parts[0]
652+
else:
653+
sub_dataset = ""
650654
extra_path = machine_config.processed_extra_directory
651655
mrc_out = (
652656
core

0 commit comments

Comments
 (0)