Skip to content

Suppress NumPy 2.4 VisibleDeprecationWarning for align=0 in test - #822

Merged
d-v-b merged 2 commits into
zarr-developers:mainfrom
maxrjones:fix-tests
Mar 17, 2026
Merged

d-v-b merged 2 commits into
zarr-developers:mainfrom
maxrjones:fix-tests

Conversation

@maxrjones

Copy link
Copy Markdown
Member

Old .npy fixture files and pickled data contain NumPy dtype descriptors with align=0 (an integer). NumPy 2.4 deprecated this, requiring align to be a boolean, which causes VisibleDeprecationWarning to be raised during np.load(), pickle.loads(), and .view(dtype=...) calls.

I added warnings.catch_warnings() filters in check_backwards_compatibility() to suppress this warning in the three affected code paths (fixture loading, codec decoding, and dtype view).

The fixture data itself remains untouched — the backwards compatibility tests continue to validate that old encoded data can still be decoded correctly.

Claude assisted in these changes

Closes #821

TODO:

  • Unit tests and/or doctests in docstrings
  • Tests pass locally
  • Docstrings and API docs for any new/modified user-facing classes and functions
  • Changes documented in docs/release.rst
  • Docs build locally
  • GitHub Actions CI passes
  • Test coverage to 100% (Codecov passes)

@codecov

codecov Bot commented Mar 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.33%. Comparing base (408a367) to head (87f0fc9).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##            main     #822       +/-   ##
==========================================
+ Coverage   2.14%   99.33%   +97.18%     
==========================================
  Files         26       26               
  Lines        884      898       +14     
==========================================
+ Hits          19      892      +873     
+ Misses       865        6      -859     

see 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maxrjones
maxrjones requested a review from a team March 17, 2026 19:18
@d-v-b
d-v-b merged commit eab1742 into zarr-developers:main Mar 17, 2026
27 of 34 checks passed
@maxrjones
maxrjones deleted the fix-tests branch March 17, 2026 20:08
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.

CI test failures

2 participants