Skip to content

Commit bd3375c

Browse files
committed
Tests failed as regex wrong
1 parent d7764fc commit bd3375c

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/cryoemservices/services/denoise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def denoise(self, rw, header: dict, message: dict):
333333
# Take file name for Relion-type projects, or folder name for SXT-style
334334
tomo_name = (
335335
denoised_full_path.name
336-
if re.match("/job[0-9]+/", str(denoised_full_path))
336+
if re.match(".*/job[0-9]+/.*", str(denoised_full_path))
337337
else f"{denoised_full_path.parent.parent}_denoised.mrc"
338338
)
339339
shutil.copy(

src/cryoemservices/services/membrain_seg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def membrain_seg(self, rw, header: dict, message: dict):
274274
# Take file name for Relion-type projects, or folder name for SXT-style
275275
tomo_name = (
276276
segmented_path.name
277-
if re.match("/job[0-9]+/", str(segmented_path))
277+
if re.match(".*/job[0-9]+/.*", str(segmented_path))
278278
else f"{segmented_path.parent.parent}_segmented.mrc"
279279
)
280280
shutil.copy(segmented_path, segmented_path.parent.parent.parent / tomo_name)

src/cryoemservices/services/tomo_align_aretomo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,12 +860,12 @@ def _tilt(file_list_for_tilts):
860860
# Take file name for Relion-type projects, or folder name for SXT-style
861861
stack_name = (
862862
Path(tomo_params.stack_file).name
863-
if re.match("job[0-9]+", tomo_params.stack_file)
863+
if re.match(".*/job[0-9]+/.*", tomo_params.stack_file)
864864
else f"{Path(tomo_params.stack_file).parent.parent}_stack.mrc"
865865
)
866866
tomo_name = (
867867
aretomo_output_path.name
868-
if re.match("job[0-9]+", str(aretomo_output_path))
868+
if re.match(".*/job[0-9]+/.*", str(aretomo_output_path))
869869
else f"{aretomo_output_path.parent.parent}_volume.mrc"
870870
)
871871
shutil.copy(Path(tomo_params.stack_file), project_dir.parent / stack_name)

0 commit comments

Comments
 (0)