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-37995: Improve storage class override logic #791

Merged
merged 3 commits into from Feb 28, 2023
Merged

Conversation

andy-slac
Copy link
Contributor

@andy-slac andy-slac commented Feb 21, 2023

In trusted mode the datastore has to use original registry storage class
to search for artifacts. Because datastore has no access to registry
a new method was added to Datastore class to specify a way to retrieve
registry dataset type based on its name (dependency inversion).

Butler instances use this new method to provide access to to dataset
type mapping. In case of QBB, when registry does not exist this mapping
has to be provided when constructing QBB.

Checklist

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

@codecov
Copy link

codecov bot commented Feb 21, 2023

Codecov Report

Base: 85.54% // Head: 85.54% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (d6265b5) compared to base (e9fb00b).
Patch coverage: 91.54% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #791   +/-   ##
=======================================
  Coverage   85.54%   85.54%           
=======================================
  Files         266      266           
  Lines       35137    35186   +49     
  Branches     7377     7388   +11     
=======================================
+ Hits        30057    30100   +43     
- Misses       3765     3768    +3     
- Partials     1315     1318    +3     
Impacted Files Coverage Δ
python/lsst/daf/butler/_butler.py 75.71% <66.66%> (-0.08%) ⬇️
python/lsst/daf/butler/_quantum_backed.py 88.26% <85.71%> (-0.18%) ⬇️
tests/test_datastore.py 99.16% <92.59%> (-0.18%) ⬇️
python/lsst/daf/butler/datastores/fileDatastore.py 81.08% <93.33%> (+0.19%) ⬆️
python/lsst/daf/butler/core/datastore.py 79.83% <100.00%> (+0.16%) ⬆️
tests/test_quantumBackedButler.py 98.14% <100.00%> (ø)

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.

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

I'm not overly happy but this is the pragmatic solution :-)

python/lsst/daf/butler/datastores/fileDatastore.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/datastores/fileDatastore.py Outdated Show resolved Hide resolved
tests/test_datastore.py Show resolved Hide resolved
python/lsst/daf/butler/core/datastore.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/_quantum_backed.py Outdated Show resolved Hide resolved
tests/test_datastore.py Outdated Show resolved Hide resolved
tests/test_datastore.py Outdated Show resolved Hide resolved
tests/test_datastore.py Outdated Show resolved Hide resolved
tests/test_datastore.py Outdated Show resolved Hide resolved
tests/test_quantumBackedButler.py Show resolved Hide resolved
andy-slac and others added 2 commits February 27, 2023 17:29
In trusted mode the datastore has to use original registry storage class
to search for artifacts. Because datastore has no access to registry
a new method was added to Datastore class to specify a way to retrieve
registry dataset type based on its name (dependency inversion).

Butler instances use this new method to provide access to to dataset
type mapping. In case of QBB, when registry does not exist this mapping
has to be provided when constructing QBB.
Co-authored-by: Tim Jenness <tjenness@lsst.org>
@andy-slac andy-slac merged commit 5c8060e into main Feb 28, 2023
@andy-slac andy-slac deleted the tickets/DM-37995 branch February 28, 2023 04:56
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