Repository navigation
Support numpy < 2. - #23
Merged
Merged
Conversation
The `numpy>2` requirement only existed because `np.trapezoid` was added in numpy 2.0. Fall back to `np.trapz` when `np.trapezoid` is not available, relax the requirement to `numpy>=1.24`, and test that floor in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N6zUsPoxW26srMeWormpe8
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 450 455 +5
=========================================
+ Hits 450 455 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N6zUsPoxW26srMeWormpe8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
numpy>2requirement was added in #8 only becausenp.trapezoidis new in numpy 2.0. Nothing else incolorsynthneeds numpy 2.Changes
_colorsynth.pyimportsnumpy.trapezoidas_trapezoid, and falls back tonumpy.trapzon numpy < 2. The fallback can't just callnp.trapz, because numpy 2.4 removed it.numpy>2tonumpy>=1.24. The old specifier also excluded numpy 2.0.0 itself, which was probably not intended.tests.ymlgets one extra job,ubuntu-latest, Python 3.10, numpy==1.24.*, that tests the floor. That job also uploads coverage for thenp.trapzbranch. The other jobs keep their names unchanged, because the repository ruleset requires them as status checks.Testing
Run locally against the source tree:
The warning count (30) is the same on every version. pyright 1.1.411 (the CI version) and black are clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01N6zUsPoxW26srMeWormpe8