Skip to content

Conversation

@slowjazz
Copy link
Contributor

Decoding with PCodec is causing issues in upstream zarr because it's being expected to handle numpy arrays. It seems like the other codecs in this library perform input validation in their respective implementations and generally support numpy arrays as a buffer-like.

This PR:

  • calls ensure_bytes on the input type for PCodec.decode()
  • updates unit tests. the former check_encode_decode_array_to_bytes seems to be a more restrictive version of check_encode_decode_array.

ref: zarr-developers/zarr-python#3176

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)

@slowjazz slowjazz marked this pull request as ready for review June 27, 2025 21:48
@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.00%. Comparing base (73a21c4) to head (80d4de4).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
numcodecs/tests/test_pcodec.py 0.00% 3 Missing ⚠️
numcodecs/pcodec.py 50.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (20.00%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (89.00%) is below the target coverage (100.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #756      +/-   ##
==========================================
+ Coverage   88.83%   89.00%   +0.16%     
==========================================
  Files          64       64              
  Lines        2580     2574       -6     
==========================================
- Hits         2292     2291       -1     
+ Misses        288      283       -5     
Files with missing lines Coverage Δ
numcodecs/tests/common.py 100.00% <ø> (+4.02%) ⬆️
numcodecs/pcodec.py 7.40% <50.00%> (-0.14%) ⬇️
numcodecs/tests/test_pcodec.py 12.90% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@d-v-b d-v-b merged commit 4613723 into zarr-developers:main Nov 20, 2025
46 of 51 checks passed
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.

2 participants