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

Array & Group: Use already loaded attributes to populate cache. #1734

Merged
merged 5 commits into from Apr 5, 2024

Conversation

dcherian
Copy link
Contributor

@dcherian dcherian commented Mar 29, 2024

[Description of PR]

Spotted this quick (possible) optimization.

_load_metadata (two lines above) has already downloaded the attributes. May as well populate the cache ahead of the time if cache_attrs is True (which is the default)

TODO:

  • Changes documented in docs/release.rst
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@dcherian dcherian changed the title Array: Use already loaded attributes to populate cache. Array & Group: Use already loaded attributes to populate cache. Mar 29, 2024
zarr/core.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.98%. Comparing base (aa9a0d5) to head (4bee89b).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1734      +/-   ##
==========================================
- Coverage   99.99%   99.98%   -0.01%     
==========================================
  Files          38       38              
  Lines       14610    14614       +4     
==========================================
+ Hits        14609    14612       +3     
- Misses          1        2       +1     
Files Coverage Δ
zarr/attrs.py 100.00% <100.00%> (ø)
zarr/core.py 100.00% <ø> (ø)
zarr/hierarchy.py 99.79% <100.00%> (-0.21%) ⬇️

* main:
  Couple fixes (zarr-developers#1737)
  Bump actions/setup-python from 5.0.0 to 5.1.0 (zarr-developers#1736)
  Optimize Array.info and Group.info (zarr-developers#1733)
  chore: update pre-commit hooks (zarr-developers#1738)
@jhamman jhamman merged commit 0cfd2be into zarr-developers:main Apr 5, 2024
18 checks passed
@dcherian dcherian deleted the use-cached-attrs branch April 5, 2024 02:13
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