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

Warn the user when shape or chunks contains float values #2579

Merged
merged 2 commits into from
Dec 28, 2024

Conversation

faymanns
Copy link
Contributor

@faymanns faymanns commented Dec 20, 2024

When shape or chunks contains float values, the digits after the decimal point are trimmed.
This pull request generates a UserWarning when one or multiple values in shape or chunks are non-integer.
The problem is described in more detail in #2530 and is already fixed in v3 by PR #2535.

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)

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.95%. Comparing base (2ab280a) to head (1ae98fd).
Report is 1 commits behind head on support/v2.

Additional details and impacted files
@@             Coverage Diff             @@
##           support/v2    #2579   +/-   ##
===========================================
  Coverage       99.95%   99.95%           
===========================================
  Files              38       38           
  Lines           14666    14672    +6     
===========================================
+ Hits            14660    14666    +6     
  Misses              6        6           
Files with missing lines Coverage Δ
zarr/tests/test_creation.py 100.00% <100.00%> (ø)
zarr/tests/test_util.py 100.00% <100.00%> (ø)
zarr/util.py 100.00% <100.00%> (ø)

Copy link
Contributor

@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

Thanks a lot, this looks good!

@dstansby dstansby added the V2 Affects the v2 branch label Dec 20, 2024
@dstansby dstansby merged commit c969f5c into zarr-developers:support/v2 Dec 28, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V2 Affects the v2 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants