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-35082 Save DimensionUniverse in QuantumGraph #259

Merged
merged 7 commits into from Jul 14, 2022
Merged

Conversation

natelust
Copy link
Contributor

@natelust natelust commented Jul 4, 2022

Save the DimensionUniverse used to create the graph in the graphs header data. This removes the need to pass the Universe as an argument to load, and ensures that things are properly reconstructed, if the DimensionUniverse changes with a schema migration.

Requires lsst/daf_butler#711

Checklist

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

@codecov
Copy link

codecov bot commented Jul 4, 2022

Codecov Report

Merging #259 (bf9deea) into main (e25eb00) will increase coverage by 0.09%.
The diff coverage is 85.71%.

❗ Current head bf9deea differs from pull request most recent head b388341. Consider uploading reports for the commit b388341 to get more accurate results

@@            Coverage Diff             @@
##             main     #259      +/-   ##
==========================================
+ Coverage   72.20%   72.29%   +0.09%     
==========================================
  Files          60       60              
  Lines        6734     6768      +34     
  Branches     1387     1393       +6     
==========================================
+ Hits         4862     4893      +31     
- Misses       1649     1651       +2     
- Partials      223      224       +1     
Impacted Files Coverage Δ
python/lsst/pipe/base/graph/_loadHelpers.py 84.61% <ø> (ø)
python/lsst/pipe/base/tests/no_dimensions.py 0.00% <0.00%> (ø)
python/lsst/pipe/base/tests/simpleQGraph.py 69.48% <66.66%> (-0.46%) ⬇️
python/lsst/pipe/base/pipeline.py 61.61% <75.00%> (+0.09%) ⬆️
...thon/lsst/pipe/base/graph/_versionDeserializers.py 63.75% <83.33%> (+0.54%) ⬆️
python/lsst/pipe/base/config.py 69.49% <100.00%> (+1.07%) ⬆️
python/lsst/pipe/base/graph/graph.py 82.65% <100.00%> (+0.84%) ⬆️
python/lsst/pipe/base/testUtils.py 92.46% <100.00%> (ø)
tests/test_quantumGraph.py 95.13% <100.00%> (-0.45%) ⬇️
... 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 e25eb00...b388341. Read the comment docs.

Save the DimensionUniverse used to create the graph in the graphs
header data. This removes the need to pass the Universe as an
argument to load, and ensures that things are properly
reconstructed, if the DimensionUniverse changes with a schema
migration.
@natelust natelust force-pushed the tickets/DM-35082 branch 4 times, most recently from 9146a52 to 7f0195c Compare July 6, 2022 20:32
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 good, couple of minor comments.

python/lsst/pipe/base/graph/graph.py Outdated Show resolved Hide resolved
python/lsst/pipe/base/config.py Outdated Show resolved Hide resolved
python/lsst/pipe/base/pipeline.py Outdated Show resolved Hide resolved
@natelust natelust force-pushed the tickets/DM-35082 branch 3 times, most recently from 48aaf2d to a1b8312 Compare July 12, 2022 19:36
If a DimensionUniverse is supplied, check that it is compatible
with the one saved in the graph.
if (universeConfig := infoMap.get("universe")) is not None:
universe = DimensionUniverse(config=DimensionConfig(universeConfig))
else:
universe = DimensionUniverse()
Copy link
Member

Choose a reason for hiding this comment

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

I worry a bit that we should be using a universe that was passed into the loader if such a universe exists, although I imagine this code path is never going to trigger because historically people haven't been persisting their graph so that they can load it again 6 months later.

@timj timj merged commit d1a5d7e into main Jul 14, 2022
@timj timj deleted the tickets/DM-35082 branch July 14, 2022 00:00
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

3 participants