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

Add noexcept to _utils C-equiv functions #641

Merged
merged 5 commits into from
Nov 18, 2024

Conversation

jakirkham
Copy link
Member

The functions in _utils are effectively straight C functions. In Cython 0.x, these would have been treated as noexcept by default. However in Cython 3.x all functions are treated as potentially raising exceptions (including these). While that is a sensible default in general, these functions still won't raise exceptions. So tidy things up by adding noexcept to turn off the additional Cython checks emitted in and around them.


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)

The functions in `_utils` are effectively straight C functions. In
Cython 0.x, these would have been treated as `noexcept` by default.
However in Cython 3.x all functions are treated as potentially raising
exceptions (including these). While that is a sensible default in
general, these functions still won't raise exceptions. So tidy things up
by adding `noexcept` to turn off the additional Cython checks emitted in
and around them.
Copy link

codecov bot commented Nov 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.88%. Comparing base (145f57c) to head (83b8095).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #641   +/-   ##
=======================================
  Coverage   99.88%   99.88%           
=======================================
  Files          62       62           
  Lines        2723     2723           
=======================================
  Hits         2720     2720           
  Misses          3        3           
---- 🚨 Try these New Features:

@jakirkham
Copy link
Member Author

Failures seen here are unrelated and seen elsewhere

xref: #642 (comment)

@jakirkham jakirkham added this to the 0.14.1 milestone Nov 17, 2024
@jakirkham
Copy link
Member Author

Closing and reopening for CI (coverage)

@jakirkham jakirkham closed this Nov 17, 2024
@jakirkham jakirkham deleted the add_utils_noexcept branch November 17, 2024 00:12
@jakirkham jakirkham restored the add_utils_noexcept branch November 17, 2024 00:17
@jakirkham jakirkham reopened this Nov 17, 2024
dstansby and others added 2 commits November 17, 2024 15:54
Fixes a Cython warning when using the opposite ordering.
@dstansby
Copy link
Contributor

pre-commit.ci autofix

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 - @jakirkham feel free to self merge if tests pass fine

@dstansby dstansby merged commit a345db6 into zarr-developers:main Nov 18, 2024
25 of 26 checks passed
@jakirkham jakirkham deleted the add_utils_noexcept branch November 18, 2024 19:21
@jakirkham
Copy link
Member Author

Thanks David! 🙏

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