Skip to content

Implement add_rose_experiment and delete/archive/run_experiments to CylcRoseManager#59

Open
edoyango wants to merge 4 commits into
ACCESS-NRI:mainfrom
edoyango:cycl-rose-manager
Open

Implement add_rose_experiment and delete/archive/run_experiments to CylcRoseManager#59
edoyango wants to merge 4 commits into
ACCESS-NRI:mainfrom
edoyango:cycl-rose-manager

Conversation

@edoyango

Copy link
Copy Markdown
Collaborator

This PR implements features in CylcRoseManager that are missing (compared to PayuManager).

run_experiments uses the rose suite-run cmd as I don't think there's a good python api to use for rose. rose suite-run is executed with --no-gcontrol so the gui isn't launched. Like in PayuManager, the experiments' status is set to DONE immediately after launching the pipeline.

@codecov

codecov Bot commented Apr 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0e45847) to head (602a727).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #59   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines          948      1023   +75     
=========================================
+ Hits           948      1023   +75     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/access/profiling/cylc_manager.py
if not experiment_path.is_dir():
raise ValueError(f"Experiment path '{experiment_path}' does not exist or is not a directory.")

run_path = Path("/scratch") / project / getpass.getuser() / "cylc-run" / rose

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic to build the run path seems to be very Gadi specific. I would prefer to keep this as general as possible, so could the function take the run_path as argument instead of the project?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like i can get cylc's expected run directory with cylc get-global-config -i '[hosts][localhost]run directory'. The downside being that you need cylc7 module loaded. Would that be preferred, or explicitly pass in run_path?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep this simple and explicitly pass the run path. Users can always use the cylc command in their notebooks if they feel like it.

Comment thread src/access/profiling/cylc_manager.py Outdated
Comment on lines +140 to +153
if all_experiments and experiments is not None:
raise ValueError("Pass either experiments=[...] or all_experiments=True")
if not all_experiments and not experiments:
raise ValueError("No experiments specified. Pass either experiments=[...] or all_experiments=True")

existing = set(self.experiments.keys())
names_to_delete = existing if all_experiments else set(experiments)

unmanaged = [e for e in names_to_delete if e not in existing]
if unmanaged:
raise KeyError(
f"Experiments {unmanaged} are not managed by this CylcRoseManager "
f"(existing: {existing}). Please check the names and try again."
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like these lines are identical to the payu ones. Maybe these could be moved to the base class?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds sensible!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes!

If I may, I would suggest a slight different approach, more OOP.

Instead of creating a helper function in the base class, I would add a delete_experiments method in the base class that contains the shared code and then calls a deferred method that deletes a single experiment. The deferred method would then be implemented in each of the concrete managers. That way the dependency is inverted and the control flow points from the abstract class to the children.

@micaeljtoliveira

Copy link
Copy Markdown
Member

@edoyango Forgot to say in the review that you need to rebase on main to get the Conda build CI failure fixed.

edoyango and others added 3 commits May 13, 2026 08:08
…to CylcRoseManager

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Codex <codex@openai.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@edoyango edoyango force-pushed the cycl-rose-manager branch from fec1a39 to 4f4890a Compare May 12, 2026 22:09
Both PayuManager and CylcRoseManager had identical logic for validating
and resolving experiment name selections. Move it to a single base-class
helper so each subclass only owns its deletion mechanics.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants