Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-33634: Add pipetask purge and cleanup subcommands #178

Merged
merged 3 commits into from Apr 4, 2022
Merged

Conversation

n8pease
Copy link
Contributor

@n8pease n8pease commented Mar 30, 2022

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@n8pease n8pease force-pushed the tickets/DM-33634 branch 2 times, most recently from 874e10a to cbf395f Compare March 30, 2022 23:06
@codecov
Copy link

codecov bot commented Apr 4, 2022

Codecov Report

Merging #178 (e154e9f) into main (29afa99) will increase coverage by 1.16%.
The diff coverage is 94.29%.

@@            Coverage Diff             @@
##             main     #178      +/-   ##
==========================================
+ Coverage   81.38%   82.55%   +1.16%     
==========================================
  Files          41       47       +6     
  Lines        3298     3628     +330     
  Branches      550      588      +38     
==========================================
+ Hits         2684     2995     +311     
- Misses        454      465      +11     
- Partials      160      168       +8     
Impacted Files Coverage Δ
python/lsst/ctrl/mpexec/cli/script/confirmable.py 83.78% <83.78%> (ø)
python/lsst/ctrl/mpexec/cli/script/purge.py 93.00% <93.00%> (ø)
tests/test_cliCmdCleanup.py 95.91% <95.91%> (ø)
tests/test_cliCmdPurge.py 96.72% <96.72%> (ø)
python/lsst/ctrl/mpexec/cli/script/cleanup.py 96.77% <96.77%> (ø)
python/lsst/ctrl/mpexec/cli/cmd/__init__.py 100.00% <100.00%> (ø)
python/lsst/ctrl/mpexec/cli/cmd/commands.py 84.05% <100.00%> (+4.42%) ⬆️
python/lsst/ctrl/mpexec/cli/opt/__init__.py 100.00% <100.00%> (ø)
python/lsst/ctrl/mpexec/cli/opt/arguments.py 100.00% <100.00%> (ø)
python/lsst/ctrl/mpexec/cli/opt/options.py 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29afa99...e154e9f. Read the comment docs.

@n8pease n8pease merged commit 109a262 into main Apr 4, 2022
@n8pease n8pease deleted the tickets/DM-33634 branch April 4, 2022 19:53
butler_config : str
The path location of the gen3 butler/registry config file.
collection : str
TODO
Copy link
Member

Choose a reason for hiding this comment

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

Missing docstring.

self.type = type

def __str__(self):
return f'COLLETION must be a CHAINED collection, "{self.collection}" is a "{self.type}" collection.'
Copy link
Member

Choose a reason for hiding this comment

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

typo: COLLETION

butler = Butler(self.butler_config, writeable=True)
for collection in self.others_to_remove:
butler.registry.removeCollection(collection)
butler.removeRuns(self.runs_to_remove)
Copy link
Member

Choose a reason for hiding this comment

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

Probably worth wrapping this line and the for loop above in with butler.transaction() so it's all atomic.

"""
pass

@abstractmethod
Copy link
Member

Choose a reason for hiding this comment

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

I believe

@property
@abstractmethod

is now preferred.


def __str__(self):
parents = ", ".join([f'"{p}"' for p in self.parents])
return f'Collection "{self.child}" is in multiple chained collections: {parents}.\n' + advice
Copy link
Member

Choose a reason for hiding this comment

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

Since you've already got an f-string going, just interpolate advice in, too.

def __init__(self, butler_config: str):
self.runs_to_remove = []
self.chains_to_remove = []
self.others_to_remove = []
Copy link
Member

Choose a reason for hiding this comment

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

Making these sets instead of lists seems like would reflect the usage better, unless you're concerned about printing them for confirmation in a way that maintains order.

purge_result : PurgeResult
The description of what datasets to remove and/or failures encountered
while preparing to remove datasets to remove, and a completion function
to remove the datests after confirmation, if needed.
Copy link
Member

Choose a reason for hiding this comment

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

typo: datests

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.

None yet

2 participants