Skip to content

Support disk-level experiment purging in access-profiling#50

Merged
minghangli-uni merged 1 commit intomainfrom
49-support-purge_experiments
Feb 27, 2026
Merged

Support disk-level experiment purging in access-profiling#50
minghangli-uni merged 1 commit intomainfrom
49-support-purge_experiments

Conversation

@minghangli-uni
Copy link
Copy Markdown
Collaborator

closes #49

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (09d20f5) to head (624576c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #50   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines          834       854   +20     
=========================================
+ Hits           834       854   +20     

☔ 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.

@minghangli-uni minghangli-uni self-assigned this Feb 4, 2026
Copy link
Copy Markdown
Member

@micaeljtoliveira micaeljtoliveira left a comment

Choose a reason for hiding this comment

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

@minghangli-uni Thanks for creating this PR! I know this is still marked as draft, but I took the liberty of having a look and adding some suggestions. I hope that's fine.

Comment thread src/access/profiling/payu_manager.py Outdated
Comment thread src/access/profiling/payu_manager.py Outdated
Comment thread src/access/profiling/payu_manager.py
@minghangli-uni minghangli-uni force-pushed the 49-support-purge_experiments branch 2 times, most recently from 84874dc to 34898dc Compare February 23, 2026 12:49
@minghangli-uni minghangli-uni marked this pull request as ready for review February 23, 2026 12:51
@minghangli-uni
Copy link
Copy Markdown
Collaborator Author

@micaeljtoliveira would you mind having another look?

Copy link
Copy Markdown
Member

@micaeljtoliveira micaeljtoliveira left a comment

Choose a reason for hiding this comment

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

@minghangli-uni Thanks for the changes. This looks almost ready, just a couple of suggestions.

Comment thread src/access/profiling/payu_manager.py Outdated
if exp.status == ProfilingExperimentStatus.RUNNING:
exp.status = ProfilingExperimentStatus.DONE

def purge_experiments(
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.

Suggested change
def purge_experiments(
def delete_experiments(

Since this now also deletes the experiments from the manager, I think "delete" would be clearer than "purge". This requires some updates to the docstring and comments for consistency.

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.

Yeah agreed. Re the existing delete_experiment, I think renaming it to something clearer, like clean_experiment? I'd prefer to do that in a separate PR.

Another thing is that the runner's delete_experiments currently maps onto payu sweep semantics. Without hard flag it's really a sweep/cleanup only, and with hard it removes the directory. To avoid ambiguity in this repo, I'm leaning towards making delete_experiments deterministic - delete always means a hard delete, so users dont have to remember a flag to know whether delete actually deletes.

Copy link
Copy Markdown
Member

@micaeljtoliveira micaeljtoliveira Feb 26, 2026

Choose a reason for hiding this comment

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

Re the existing delete_experiment, I think renaming it to something clearer, like clean_experiment? I'd prefer to do that in a separate PR.

Yes, I agree, that one needs to be renamed (I'm thinking to rename it to something like drop_experiment so it's a bit clearer it does not touch the filesystem). I can take care of it in a different PR, no worries.

Another thing is that the runner's delete_experiments currently maps onto payu sweep semantics. Without hard flag it's really a sweep/cleanup only, and with hard it removes the directory. To avoid ambiguity in this repo, I'm leaning towards making delete_experiments deterministic - delete always means a hard delete, so users dont have to remember a flag to know whether delete actually deletes.

I agree, here it's better to always to a hard delete. Maybe later we can add a Payu-specific method to do a sweep, but I'm not sure that's really useful here.

Comment thread src/access/profiling/payu_manager.py Outdated
dry_run: bool = False,
remove_repo_dir: bool = False,
) -> None:
"""Purges Payu experiments from the work directory.
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.

Suggested change
"""Purges Payu experiments from the work directory.
"""Delete Payu experiments from the work directory and remove them from the manager.

@minghangli-uni
Copy link
Copy Markdown
Collaborator Author

Thanks @micaeljtoliveira for your suggestion. Would you mind taking another look at this?

@minghangli-uni
Copy link
Copy Markdown
Collaborator Author

I'll clean up the history before merge

@minghangli-uni minghangli-uni force-pushed the 49-support-purge_experiments branch from fafc23b to bbd5d45 Compare February 27, 2026 03:08
@minghangli-uni minghangli-uni force-pushed the 49-support-purge_experiments branch from bbd5d45 to 624576c Compare February 27, 2026 03:09
@minghangli-uni minghangli-uni merged commit 939e66c into main Feb 27, 2026
8 checks passed
@minghangli-uni minghangli-uni deleted the 49-support-purge_experiments branch February 27, 2026 03:28
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.

Add support for purge_experiments() from work directory

2 participants