Skip to content

Commit aba0618

Browse files
committed
'MachineConfig.rsync_basepath' is now no longer None
1 parent 67e9322 commit aba0618

File tree

4 files changed

+0
-16
lines changed

4 files changed

+0
-16
lines changed

src/murfey/server/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,8 +1622,6 @@ def _register_class_selection(message: dict, _db=murfey_db, demo: bool = False):
16221622

16231623
def _find_initial_model(visit: str, machine_config: MachineConfig) -> Path | None:
16241624
if machine_config.initial_model_search_directory:
1625-
if not machine_config.rsync_basepath:
1626-
return None
16271625
visit_directory = (
16281626
machine_config.rsync_basepath
16291627
/ (machine_config.rsync_module or "data")

src/murfey/server/api/__init__.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,8 +1291,6 @@ def suggest_path(
12911291
raise ValueError(
12921292
"No machine configuration set when suggesting destination path"
12931293
)
1294-
if not machine_config.rsync_basepath:
1295-
raise ValueError("No rsync basepath set")
12961294

12971295
# Construct the full path to where the dataset is to be saved
12981296
check_path = machine_config.rsync_basepath / base_path
@@ -1416,8 +1414,6 @@ def start_dc(
14161414
machine_config = get_machine_config(instrument_name=instrument_name)[
14171415
instrument_name
14181416
]
1419-
if not machine_config.rsync_basepath:
1420-
raise ValueError("No rsync basepath set")
14211417
log.info(
14221418
f"Starting data collection on microscope {get_microscope(machine_config=machine_config)} "
14231419
f"with basepath {sanitise(str(machine_config.rsync_basepath))} and directory {sanitise(dc_params.image_directory)}"
@@ -1505,8 +1501,6 @@ async def process_gain(
15051501
executables = machine_config.external_executables
15061502
env = machine_config.external_environment
15071503
safe_path_name = secure_filename(gain_reference_params.gain_ref.name)
1508-
if not machine_config.rsync_basepath:
1509-
raise ValueError("No rsync basepath set")
15101504
filepath = (
15111505
machine_config.rsync_basepath
15121506
/ (machine_config.rsync_module or "data")
@@ -1595,8 +1589,6 @@ async def write_eer_fractionation_file(
15951589
)
15961590
) / secure_filename(fractionation_params.fractionation_file_name)
15971591
else:
1598-
if not machine_config.rsync_basepath:
1599-
raise ValueError("rsync basepath not set")
16001592
file_path = (
16011593
machine_config.rsync_basepath
16021594
/ (machine_config.rsync_module or "data")
@@ -1642,8 +1634,6 @@ async def make_gif(
16421634
machine_config = get_machine_config(instrument_name=instrument_name)[
16431635
instrument_name
16441636
]
1645-
if not machine_config.rsync_basepath:
1646-
raise ValueError("rsync basepath not set")
16471637
output_dir = (
16481638
machine_config.rsync_basepath
16491639
/ (machine_config.rsync_module or "data")

src/murfey/server/api/clem.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ def validate_and_sanitise(
7777
machine_config = get_machine_config(instrument_name=instrument_name)[
7878
instrument_name
7979
]
80-
if not machine_config.rsync_basepath:
81-
raise ValueError("rsync basepath not set")
8280
base_path = machine_config.rsync_basepath.as_posix()
8381

8482
# Check that full file path doesn't contain unallowed characters

src/murfey/server/api/spa.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ def _cryolo_model_path(visit: str, instrument_name: str) -> Path:
2121
instrument_name
2222
]
2323
# Raise error if relevant keys weren't set in MachineConfig
24-
if not machine_config.rsync_basepath:
25-
raise ValueError("Unable to find crYOLO model; rsync_basepath was not set")
2624
if not machine_config.default_model:
2725
raise ValueError("No default crYOLO model was set")
2826

0 commit comments

Comments
 (0)