Skip to content

Further validation of v3 fill values #2216

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

Closed
wants to merge 4 commits into from

Conversation

jhamman
Copy link
Member

@jhamman jhamman commented Sep 20, 2024

This adds an additional check that the provided fill value is representable by the dtype of an array. Previously, the following behavior was allowed,

In [3]: a = zarr.create(shape=(2, 2), dtype='uint8', fill_value=22.5)

In [4]: a.fill_value
Out[4]: np.uint8(22)

In this case, the dtype was silently converted to a int type 😢 .

Built on top of #2209
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)

@jhamman
Copy link
Member Author

jhamman commented Sep 21, 2024

merged into #2209.

@jhamman jhamman closed this Sep 21, 2024
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.

1 participant