From ebca4aaa7662bf04bf09f3b0453763f748ac359b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 23:36:23 +0000 Subject: [PATCH 1/2] Initial plan From 5d8f0b7555d50f3097ad5eed040ec706922ce781 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 23:45:42 +0000 Subject: [PATCH 2/2] Fix setup() docstring: clarify spinup_run_dir usage, remove stale comment Agent-Logs-Url: https://github.com/alexolinhager/compass/sessions/db26aabb-81b4-48b7-8fdf-906b46c00537 Co-authored-by: alexolinhager <131483939+alexolinhager@users.noreply.github.com> --- .../sgh_restart_ensemble/restart_member.py | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/compass/landice/tests/ensemble_generator/sgh_restart_ensemble/restart_member.py b/compass/landice/tests/ensemble_generator/sgh_restart_ensemble/restart_member.py index f13e64c3a8..04beb16ab1 100644 --- a/compass/landice/tests/ensemble_generator/sgh_restart_ensemble/restart_member.py +++ b/compass/landice/tests/ensemble_generator/sgh_restart_ensemble/restart_member.py @@ -79,21 +79,17 @@ def __init__(self, test_case, run_num, spinup_work_dir): def setup(self): """ - Prepare the original spinup run directory for an in-place restart. + Prepare the original run directory for an in-place restart. - Uses ``self.spinup_run_dir`` (set in ``__init__``) rather than - ``self.work_dir`` so that compass's framework files - (``step.pickle``, ``job_script.sh``, etc.) are written into the - normal compass step directory and never overwrite the original - spinup run directory. This method: + Uses ``self.spinup_run_dir`` (set in ``__init__``) to operate on the + original spinup run directory without touching ``self.work_dir``, + which compass manages as the normal step directory. + + This method: 1. Verifies the spinup run directory and namelist.landice exist. 2. Sets config_do_restart = .true. in namelist.landice. 3. Creates a restart_attempt_N/ tracking directory. - - No files are copied or moved. Job submission is handled by - EnsembleManager using the original job_script.sh that lives in - ``self.spinup_run_dir``. """ run_dir = self.spinup_run_dir @@ -110,10 +106,6 @@ def setup(self): print(f'Setting config_do_restart = .true. in {namelist_path}') _set_restart_in_namelist(namelist_path) - # Create a restart_attempt_N/ directory to track how many restarts - # have been attempted for this run. configure() counts these dirs - # to enforce max_consecutive_restarts. List the directory once to - # find the highest existing attempt number, then create the next one. existing_nums = [ int(d[len('restart_attempt_'):]) for d in os.listdir(run_dir)