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-4551: Allow override of storage class on butler.get() #737

Merged
merged 17 commits into from Oct 4, 2022
Merged

Conversation

timj
Copy link
Member

@timj timj commented Sep 28, 2022

Support data = butler.getDirect(ref, readStorageClass="AstropyTable") style overrides.

Checklist

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

@codecov
Copy link

codecov bot commented Sep 29, 2022

Codecov Report

Base: 84.70% // Head: 84.75% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (45dd790) compared to base (d4785fc).
Patch coverage: 95.48% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #737      +/-   ##
==========================================
+ Coverage   84.70%   84.75%   +0.04%     
==========================================
  Files         254      254              
  Lines       32894    32946      +52     
  Branches     5629     5632       +3     
==========================================
+ Hits        27864    27922      +58     
+ Misses       3803     3801       -2     
+ Partials     1227     1223       -4     
Impacted Files Coverage Δ
python/lsst/daf/butler/core/storageClass.py 93.93% <ø> (+0.55%) ⬆️
python/lsst/daf/butler/tests/_testRepo.py 77.30% <ø> (ø)
tests/test_datastore.py 99.26% <ø> (-0.02%) ⬇️
python/lsst/daf/butler/formatters/json.py 75.55% <57.14%> (-3.52%) ⬇️
python/lsst/daf/butler/core/datasets/ref.py 81.96% <66.66%> (-0.26%) ⬇️
python/lsst/daf/butler/formatters/yaml.py 64.70% <66.66%> (+0.55%) ⬆️
python/lsst/daf/butler/_deferredDatasetHandle.py 81.81% <85.71%> (+2.50%) ⬆️
python/lsst/daf/butler/_butler.py 79.76% <100.00%> (ø)
python/lsst/daf/butler/_limited_butler.py 81.57% <100.00%> (ø)
python/lsst/daf/butler/_quantum_backed.py 88.41% <100.00%> (ø)
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@timj timj force-pushed the tickets/DM-4551 branch 4 times, most recently from 6722881 to aefb1b6 Compare September 30, 2022 15:23
@timj timj requested a review from TallJimbo September 30, 2022 15:31
python/lsst/daf/butler/core/datasets/type.py Show resolved Hide resolved
python/lsst/daf/butler/_butler.py Outdated Show resolved Hide resolved
timj added 11 commits October 3, 2022 12:32
This can be useful when forcing storage class type conversions.
This test was there for when registry would disassemble
and give datastore individual components. We no longer
do this so there is no need to test the functionality,
especially since that relied on special logic where
the read and write storage classes did not match.
Now we have storage class conversion infrastructure
that test is no longer valid and datastore can just
depend on whether a component has been requested
without trying to guess from the storage class
discrepancy that this has been an external
disassembly.
The in-memory datastore was still trying to assume that
the storage classes not matching meant that a component
was being requested.
This is used to override the storage class associated with the
requested dataset ref.
This should lead to a very quick error message before the
data are retrieved.
@timj timj force-pushed the tickets/DM-4551 branch 2 times, most recently from 74096b3 to 9d0128d Compare October 3, 2022 20:37
It has been pointed out that a butler.get always implies
reading.
@timj timj merged commit 738e63c into main Oct 4, 2022
@timj timj deleted the tickets/DM-4551 branch October 4, 2022 16:04
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