Skip to content

Commit d1e724f

Browse files
Do not make processed directories in murfey (#807)
1 parent d62487f commit d1e724f

4 files changed

Lines changed: 1 addition & 25 deletions

File tree

src/murfey/server/api/workflow.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncio
2-
import os
32
from datetime import datetime
43
from logging import getLogger
54
from pathlib import Path
@@ -609,10 +608,6 @@ async def request_spa_preprocessing(
609608

610609
db.close()
611610

612-
if not mrc_out.parent.exists():
613-
mrc_out_dir = Path(secure_filename(str(mrc_out))).parent
614-
mrc_out_dir.mkdir(parents=True, exist_ok=True)
615-
os.chmod(mrc_out_dir, mode=machine_config.mkdir_chmod)
616611
recipe_name = machine_config.recipes.get(
617612
"em-spa-preprocess", "em-spa-preprocess"
618613
)
@@ -837,9 +832,6 @@ async def request_tomography_preprocessing(
837832
dcid = data_collection[0][1].id
838833
appid = data_collection[0][3].id
839834
murfey_ids = _murfey_id(appid, db, number=1, close=False)
840-
if not mrc_out.parent.exists():
841-
mrc_out.parent.mkdir(parents=True, exist_ok=True)
842-
os.chmod(mrc_out.parent, mode=machine_config.mkdir_chmod)
843835

844836
session_processing_parameters = db.exec(
845837
select(SessionProcessingParameters).where(
@@ -990,9 +982,6 @@ def register_completed_tilt_series(
990982
/ "tomograms"
991983
/ f"{ts.tag}_stack.mrc"
992984
)
993-
if not stack_file.parent.exists():
994-
stack_file.parent.mkdir(parents=True)
995-
os.chmod(stack_file.parent, mode=machine_config.mkdir_chmod)
996985
tilt_offset = midpoint([float(get_angle(t)) for t in tilts])
997986
zocalo_message = {
998987
"recipes": ["em-tomo-align"],

src/murfey/server/feedback.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import logging
1111
import math
12-
import os
1312
import subprocess
1413
import time
1514
from datetime import datetime
@@ -1409,10 +1408,6 @@ def _flush_tomography_preprocessing(message: dict, _db):
14091408
detached_ids = [c.id for c in collected_ids]
14101409

14111410
murfey_ids = _murfey_id(detached_ids[3], _db, number=1, close=False)
1412-
p = Path(f.mrc_out)
1413-
if not p.parent.exists():
1414-
p.parent.mkdir(parents=True)
1415-
os.chmod(p.parent, mode=machine_config.mkdir_chmod)
14161411
movie = db.Movie(
14171412
murfey_id=murfey_ids[0],
14181413
data_collection_id=detached_ids[1],
@@ -1886,9 +1881,6 @@ def feedback_callback(header: dict, message: dict, _db=murfey_db) -> None:
18861881
/ "tomograms"
18871882
/ f"{relevant_tilt_series.tag}_stack.mrc"
18881883
)
1889-
if not stack_file.parent.exists():
1890-
stack_file.parent.mkdir(parents=True)
1891-
os.chmod(stack_file.parent, machine_config.mkdir_chmod)
18921884
tilt_offset = midpoint([float(get_angle(t)) for t in tilts])
18931885
zocalo_message = {
18941886
"recipes": ["em-tomo-align"],

src/murfey/util/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class MachineConfig(BaseModel): # type: ignore
5959
"directories": [],
6060
"files": [],
6161
}
62-
mkdir_chmod: int = 0o750
62+
mkdir_chmod: int = 0o2750
6363

6464
# Rsync setup
6565
rsync_url: str = ""

src/murfey/workflows/spa/flush_spa_preprocess.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import logging
2-
import os
32
from pathlib import Path
43
from typing import Optional
54

@@ -544,11 +543,7 @@ def flush_spa_preprocess(message: dict, murfey_db: Session) -> dict[str, bool]:
544543
)
545544
foil_hole_id = None
546545

547-
mrcp = Path(f.mrc_out)
548546
ppath = Path(f.file_path)
549-
if not mrcp.parent.exists():
550-
mrcp.parent.mkdir(parents=True)
551-
os.chmod(mrcp.parent, mode=machine_config.mkdir_chmod)
552547
movie = Movie(
553548
murfey_id=murfey_ids[2 * i],
554549
data_collection_id=collected_ids[1].id,

0 commit comments

Comments
 (0)