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-39605: Use butler.dimensions rather than butler.registry.dimensions #850

Merged
merged 28 commits into from Jun 13, 2023

Conversation

timj
Copy link
Member

@timj timj commented Jun 8, 2023

This is the preferred interface and is part of the long-term goal of lowering the visibility of butler.registry.

Checklist

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

@codecov
Copy link

codecov bot commented Jun 8, 2023

Codecov Report

Patch coverage: 99.34% and project coverage change: +0.01 🎉

Comparison is base (8597216) 87.99% compared to head (dc06cb3) 88.01%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #850      +/-   ##
==========================================
+ Coverage   87.99%   88.01%   +0.01%     
==========================================
  Files         269      269              
  Lines       35465    35514      +49     
  Branches     7442     7442              
==========================================
+ Hits        31208    31258      +50     
  Misses       3113     3113              
+ Partials     1144     1143       -1     
Impacted Files Coverage Δ
...hon/lsst/daf/butler/core/_column_categorization.py 88.57% <ø> (ø)
python/lsst/daf/butler/core/_column_tags.py 94.28% <ø> (ø)
python/lsst/daf/butler/core/storageClass.py 95.01% <ø> (ø)
python/lsst/daf/butler/instrument.py 0.00% <0.00%> (ø)
python/lsst/daf/butler/registry/_dbAuth.py 95.06% <ø> (-0.07%) ⬇️
...ython/lsst/daf/butler/registry/connectionString.py 93.33% <ø> (ø)
.../butler/registry/datasets/byDimensions/_storage.py 92.40% <ø> (ø)
...butler/registry/datasets/byDimensions/summaries.py 95.06% <ø> (ø)
...ython/lsst/daf/butler/registry/dimensions/table.py 91.16% <ø> (ø)
...n/lsst/daf/butler/registry/interfaces/_datasets.py 100.00% <ø> (ø)
... and 147 more

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

This is the preferred interface and is part of the long-term
goal of lowering the visibility of butler.registry.
@timj timj requested review from TallJimbo and andy-slac June 12, 2023 19:56
@timj
Copy link
Member Author

timj commented Jun 12, 2023

This turned into a gigantic PR. The type annotations and f-string and set changes are distinct commits if that helps. mypy and flake8 are happy and all tests pass.

@timj timj force-pushed the tickets/DM-39605 branch 2 times, most recently from e64e89c to baf5c50 Compare June 12, 2023 21:52
@timj
Copy link
Member Author

timj commented Jun 12, 2023

I've also replaced typing.AbstractSet with collections.abc.Set and fixed the pydocstyle problems.

@andy-slac
Copy link
Contributor

@TallJimbo, should we split this review in two? I could look at python/lsst/daf/butler/core/... and python/lsst/daf/butler/registry/... and leave the rest to you?

@TallJimbo
Copy link
Member

@andy-slac , that works for me.

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.

Checked butler/core, butler/registry, and butler/registries, looks good, a couple of minor comments. (@TallJimbo, you can skip registries/...)

python/lsst/daf/butler/core/configSupport.py Show resolved Hide resolved
python/lsst/daf/butler/core/timespan.py Show resolved Hide resolved
python/lsst/daf/butler/registry/queries/_structs.py Outdated Show resolved Hide resolved
standalone: bool = False,
searchPaths: Optional[List[str]] = None,
searchPaths: list[str] | None = None,
Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing many of these str values should be ResourcePathExpression, and for public APIs taking Sequence (or Iterable, if possible) is much nicer than taking list. In fact, I think if you try to make searchPath take a list of ResourcePathExpression it may not work because list is not covariant.

python/lsst/daf/butler/_butler.py Show resolved Hide resolved
python/lsst/daf/butler/_limited_butler.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/_quantum_backed.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/cli/butler.py Show resolved Hide resolved
python/lsst/daf/butler/core/composites.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/datastores/chainedDatastore.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/datastores/fileDatastore.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/datastores/fileDatastore.py Outdated Show resolved Hide resolved
@timj timj merged commit d363fbe into main Jun 13, 2023
13 checks passed
@timj timj deleted the tickets/DM-39605 branch June 13, 2023 18:18
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