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-47328: Experimental command to copy files based on a graph #454

Merged
merged 6 commits into from
Nov 5, 2024

Conversation

timj
Copy link
Member

@timj timj commented Nov 1, 2024

Requiers lsst/daf_butler#1111

cc/ @tgoldina I think this might do what you need. Please give it a try and let me know. I might change the name of the command etc.

Checklist

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

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 85.48387% with 18 lines in your changes missing coverage. Please review.

Project coverage is 83.22%. Comparing base (d7cbcf4) to head (9465cbd).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
.../pipe/base/script/retrieve_artifacts_for_quanta.py 50.00% 7 Missing ⚠️
python/lsst/pipe/base/graph/graph.py 91.17% 2 Missing and 4 partials ⚠️
python/lsst/pipe/base/cli/cmd/commands.py 86.66% 2 Missing ⚠️
...ython/lsst/pipe/base/script/transfer_from_graph.py 33.33% 2 Missing ⚠️
python/lsst/pipe/base/script/zip_from_graph.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #454      +/-   ##
==========================================
+ Coverage   83.00%   83.22%   +0.21%     
==========================================
  Files         102      103       +1     
  Lines       12135    12227      +92     
  Branches     1535     1546      +11     
==========================================
+ Hits        10073    10176     +103     
+ Misses       1655     1641      -14     
- Partials      407      410       +3     

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

@timj
Copy link
Member Author

timj commented Nov 1, 2024

@andy-slac it looks like I should add QuantumGraph.get_inputs() and QuantumGraph.get_outputs() methods. Does that seem right to you? Not sure whether they even need parameters -- just return all of them, and return datastore records for inputs and update the storage classes for the outputs.

@andy-slac
Copy link
Contributor

it looks like I should add QuantumGraph.get_inputs() and QuantumGraph.get_outputs() methods

That looks natural, indeed. Maybe generalize it a bit and add options to include init inputs/outputs and intermediates? Something like

def get_input_refs(self, *, include_init=True, include_intermediates=True) -> Iterable[DatasetRef]

?

@timj
Copy link
Member Author

timj commented Nov 1, 2024

Looking at the loops that are involved with the same loop over quanta running for both inputs and outputs, I'm edging towards a single get_refs(self, *, include_inputs=True, include_initInputs=True, include_outputs=True, include_initOutputs=True) approach.

@timj timj force-pushed the tickets/DM-47328 branch from 6b11830 to d262022 Compare November 4, 2024 18:25
@tgoldina
Copy link
Contributor

tgoldina commented Nov 4, 2024

@timj Thank you very much!

Indeed, I was able to retrieve all inputs used in a quantum graph with

$ pip install git+https://github.com/lsst/daf_butler@tickets/DM-47328
$ pip install git+https://github.com/lsst/pipe_base/@tickets/DM-47328
$ butler retrieve-artifacts-for-quanta --preserve-path --include-inputs --no-include-outputs tst.qgraph DATA tst_outdir

@timj timj force-pushed the tickets/DM-47328 branch 3 times, most recently from ba321ac to 261ac6c Compare November 4, 2024 21:49
Copy link
Contributor

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

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

Looks great, I do not have an opinion on command name for CLI, retrieve-artifacts-for-quanta looks reasonable.

python/lsst/pipe/base/graph/graph.py Show resolved Hide resolved
python/lsst/pipe/base/graph/graph.py Outdated Show resolved Hide resolved
python/lsst/pipe/base/graph/graph.py Show resolved Hide resolved
python/lsst/pipe/base/graph/graph.py Outdated Show resolved Hide resolved
python/lsst/pipe/base/graph/graph.py Outdated Show resolved Hide resolved
python/lsst/pipe/base/cli/cmd/commands.py Outdated Show resolved Hide resolved
@timj timj force-pushed the tickets/DM-47328 branch 3 times, most recently from 946fc9c to 5f4f16d Compare November 5, 2024 20:06
@timj timj force-pushed the tickets/DM-47328 branch from 427630b to 9465cbd Compare November 5, 2024 23:04
@timj timj merged commit 591c0c7 into main Nov 5, 2024
14 checks passed
@timj timj deleted the tickets/DM-47328 branch November 5, 2024 23:07
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.

3 participants