From 79712b0b9e7241bb44e71674581b669f594fc5de Mon Sep 17 00:00:00 2001 From: Patrick Miles Date: Thu, 29 Jan 2026 12:41:35 -0800 Subject: [PATCH 1/3] fix cli bug: must recalculate unet_layers in CLI since problem_scale can be overwritten iwhtout changing config object unet_layers --- ScaFFold/cli.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ScaFFold/cli.py b/ScaFFold/cli.py index 2caf981..8057e2d 100644 --- a/ScaFFold/cli.py +++ b/ScaFFold/cli.py @@ -177,9 +177,21 @@ def main(): print(f"Overriding '{key}={combined_config[key]}' with '{key}={value}'") combined_config[key] = value + # Recalculate unet_layers to capture any CLI overrides + combined_config["unet_layers"] = ( + combined_config["problem_scale"] - combined_config["unet_bottleneck_dim"] + 1 + ) + + # Resolve paths to absolute, matching Config() behavior + if "base_run_dir" in combined_config and combined_config["base_run_dir"]: + combined_config["base_run_dir"] = str(Path(combined_config["base_run_dir"]).resolve()) + + if "dataset_dir" in combined_config and combined_config["dataset_dir"]: + combined_config["dataset_dir"] = str(Path(combined_config["dataset_dir"]).resolve()) + # Calculate these variables after override combined_config["vol_size"] = pow(2, combined_config["problem_scale"]) - combined_config["point_num"] = int(combined_config["vol_size"] ** 3 / 256) + combined_config["point_num"] = int(combined_config["vol_size"] ** 3 / 256) # Handle Restart / Resume logic if hasattr(args, "restart") and args.restart == True: From c4042e1543247c36aed37e44fb524ac22623a875 Mon Sep 17 00:00:00 2001 From: Patrick Miles Date: Thu, 29 Jan 2026 12:42:46 -0800 Subject: [PATCH 2/3] whitespace --- ScaFFold/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ScaFFold/cli.py b/ScaFFold/cli.py index 8057e2d..93d9e1c 100644 --- a/ScaFFold/cli.py +++ b/ScaFFold/cli.py @@ -188,10 +188,10 @@ def main(): if "dataset_dir" in combined_config and combined_config["dataset_dir"]: combined_config["dataset_dir"] = str(Path(combined_config["dataset_dir"]).resolve()) - + # Calculate these variables after override combined_config["vol_size"] = pow(2, combined_config["problem_scale"]) - combined_config["point_num"] = int(combined_config["vol_size"] ** 3 / 256) + combined_config["point_num"] = int(combined_config["vol_size"] ** 3 / 256) # Handle Restart / Resume logic if hasattr(args, "restart") and args.restart == True: From 6d1b1366a659c5293e9dfdc9bb8039bb67b44e24 Mon Sep 17 00:00:00 2001 From: Patrick Miles Date: Thu, 29 Jan 2026 13:01:47 -0800 Subject: [PATCH 3/3] ruff --- ScaFFold/cli.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ScaFFold/cli.py b/ScaFFold/cli.py index 93d9e1c..82532fe 100644 --- a/ScaFFold/cli.py +++ b/ScaFFold/cli.py @@ -179,15 +179,21 @@ def main(): # Recalculate unet_layers to capture any CLI overrides combined_config["unet_layers"] = ( - combined_config["problem_scale"] - combined_config["unet_bottleneck_dim"] + 1 + combined_config["problem_scale"] + - combined_config["unet_bottleneck_dim"] + + 1 ) # Resolve paths to absolute, matching Config() behavior if "base_run_dir" in combined_config and combined_config["base_run_dir"]: - combined_config["base_run_dir"] = str(Path(combined_config["base_run_dir"]).resolve()) - + combined_config["base_run_dir"] = str( + Path(combined_config["base_run_dir"]).resolve() + ) + if "dataset_dir" in combined_config and combined_config["dataset_dir"]: - combined_config["dataset_dir"] = str(Path(combined_config["dataset_dir"]).resolve()) + combined_config["dataset_dir"] = str( + Path(combined_config["dataset_dir"]).resolve() + ) # Calculate these variables after override combined_config["vol_size"] = pow(2, combined_config["problem_scale"])