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

Use list comprehension where applicable #1555

Merged

Conversation

DimitriPapadopoulos
Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Oct 31, 2023

Even if this is only a test, list comprehensions are faster than repeatedly call append().

Also use tuple instead of list when possible.

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/tutorial.rst
  • Changes documented in docs/release.rst
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

Even if this is only a test, list comprehensions are faster than
repeatedly call append().

Also use tuple instead of list when possible.
@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Oct 31, 2023
@codecov
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Merging #1555 (9d45f19) into main (d756626) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1555      +/-   ##
==========================================
- Coverage   99.99%   99.99%   -0.01%     
==========================================
  Files          37       37              
  Lines       14740    14735       -5     
==========================================
- Hits        14739    14734       -5     
  Misses          1        1              
Files Coverage Δ
zarr/tests/test_indexing.py 100.00% <100.00%> (ø)

@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as ready for review October 31, 2023 09:17
Copy link
Member

@jhamman jhamman left a comment

Choose a reason for hiding this comment

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

@jhamman jhamman merged commit 54e31e9 into zarr-developers:main Dec 7, 2023
21 checks passed
@DimitriPapadopoulos DimitriPapadopoulos deleted the list_comprehension branch December 7, 2023 22:25
jhamman pushed a commit to jhamman/zarr-python that referenced this pull request Jan 24, 2024
Even if this is only a test, list comprehensions are faster than
repeatedly call append().

Also use tuple instead of list when possible.

Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs release notes Automatically applied to PRs which haven't added release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants