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

Cleanup PCodec soft dependency #647

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jakirkham
Copy link
Member

As with other soft dependencies in Numcodecs, the pattern is to attempt to import them and if their dependencies cannot be resolved skip them. Have applied this pattern to PCodec to be consistent with the other optional codec dependencies.

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)

Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.85%. Comparing base (4b95d66) to head (6dd00c0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #647      +/-   ##
==========================================
- Coverage   99.92%   99.85%   -0.08%     
==========================================
  Files          62       62              
  Lines        2761     2759       -2     
==========================================
- Hits         2759     2755       -4     
- Misses          2        4       +2     
Files with missing lines Coverage Δ
numcodecs/pcodec.py 100.00% <100.00%> (ø)
numcodecs/tests/test_pcodec.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@jakirkham jakirkham requested a review from dstansby November 18, 2024 20:55
@jakirkham
Copy link
Member Author

@dstansby could you please review this one?

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.

LGTM 👍 - do you want to add a changelog if this changes behaviour for users?

@jakirkham jakirkham changed the title Cleanup PCodec soft dependency handling Cleanup PCodec soft dependency Dec 5, 2024
@jakirkham
Copy link
Member Author

Resolved conflicts and added a changelog entry

@@ -27,6 +27,8 @@ Fixes
~~~~~
* Fixes issue with ``Delta`` Zarr 3 codec not working with ``astype``.
By :user:`Norman Rzepka <normanrz>`, :issue:`664`
* Cleanup ``PCodec`` soft dependency.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Cleanup ``PCodec`` soft dependency.
* Cleanup ``PCodec`` soft dependency.
Previously importing ``numcodecs.pcodec`` would work if ``pcodec`` is not installed,
but now it will fail to import. This mirrors the behaviour of other optional dependencies.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to have something that describes what's changed to users - I've left a suggesiton above

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