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-40156: Some code cleanups #869

Merged
merged 31 commits into from
Jul 24, 2023
Merged

DM-40156: Some code cleanups #869

merged 31 commits into from
Jul 24, 2023

Conversation

timj
Copy link
Member

@timj timj commented Jul 21, 2023

Checklist

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

@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Patch coverage: 83.61% and project coverage change: +0.03% 🎉

Comparison is base (ee6d72d) 87.76% compared to head (3c84fee) 87.79%.

❗ Current head 3c84fee differs from pull request most recent head 05bb4df. Consider uploading reports for the commit 05bb4df to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #869      +/-   ##
==========================================
+ Coverage   87.76%   87.79%   +0.03%     
==========================================
  Files         274      274              
  Lines       36057    36005      -52     
  Branches     7562     7535      -27     
==========================================
- Hits        31645    31612      -33     
+ Misses       3241     3227      -14     
+ Partials     1171     1166       -5     
Files Changed Coverage Δ
python/lsst/daf/butler/cli/cmd/commands.py 88.92% <0.00%> (-0.04%) ⬇️
python/lsst/daf/butler/core/datasets/type.py 84.25% <0.00%> (ø)
python/lsst/daf/butler/core/dimensions/_config.py 84.81% <0.00%> (ø)
...ython/lsst/daf/butler/core/storageClassDelegate.py 54.54% <ø> (ø)
python/lsst/daf/butler/registries/remote.py 80.40% <ø> (-0.20%) ⬇️
...ython/lsst/daf/butler/registry/_butler_registry.py 87.09% <0.00%> (ø)
...thon/lsst/daf/butler/registry/_registry_factory.py 84.00% <0.00%> (ø)
python/lsst/daf/butler/registry/managers.py 90.54% <0.00%> (ø)
...thon/lsst/daf/butler/script/certifyCalibrations.py 37.50% <0.00%> (+2.20%) ⬆️
python/lsst/daf/butler/script/exportCalibs.py 19.29% <0.00%> (ø)
... and 59 more

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

@timj timj requested a review from andy-slac July 24, 2023 14:57
timj added 26 commits July 24, 2023 07:57
This does not affect the tests because these functions are
used immediately inside the loop.
a = x if x else y

instead of

a = y if not x else x
Keep ones involving assertRaises and assertWarns since then
it is easier to see the separation between the test code and
the code being tested.
warnings.warn has too much other information that is irrelevant
to the user of the command-line tool.
The test code doesn't really need it but it doesn't hurt and
it makes it easier to find warnings in the future that lack
the stacklevel.
assert can be removed as a no-op depending on how python is run.
timj added 2 commits July 24, 2023 07:57
lru_cache on methods doesn't work properly. Furthermore if we
need to cache the collection type we should be caching it
elsewhere inside registry.
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, a couple of minor comments.

python/lsst/daf/butler/core/ddl.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/script/transferDatasets.py Outdated Show resolved Hide resolved
@timj timj merged commit 0787220 into main Jul 24, 2023
14 checks passed
@timj timj deleted the tickets/DM-40156 branch July 24, 2023 22:05
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.

2 participants