-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support NumPy > 2.0 and Python 3.12 #115
Conversation
…time.timezone.utc)`
WalkthroughThis pull request modifies the Changes
Assessment against linked issues
Tip Announcements
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (5)
Files skipped from review due to trivial changes (1)
Additional comments not posted (9)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #115 +/- ##
=======================================
Coverage 96.01% 96.01%
=======================================
Files 17 17
Lines 2035 2035
=======================================
Hits 1954 1954
Misses 81 81 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @lochhh!!
For future reference: I also cloned this and tested it with numpy==1.26.4
and the changes here still pass all the tests, so we should be safe in terms of backwards compatibility.
Now let's just hope that all of our deps are happy with numpy 2 as well 😄
Closes #114
This PR addresses the failing tests reported in #114 (due to deprecations in NumPy 2.0) by:
np.string_
withnp.bytes_
bool(np.all(...))
withnp.array_equal
in grayscale detectionnp.in1d
withnp.isin
In addition,
datetime.utcnow()
is also deprecated since Python 3.12. So this has been replaced withdatetime.datetime.now(datetime.timezone.utc)
. The alternative would bedatetime.datetime.now(datetime.UTC)
but this alias has only been added in version 3.11.Despite the above changes, the tests continued to fail on CI. It turns out that on conda-forge the
build
package is calledpython-build
. So I've updated this in theenvironment.yml
as well.Summary by CodeRabbit
New Features
numpy
, enhancing compatibility with newer features.Bug Fixes
Tests
np.in1d
withnp.isin
in test cases for better clarity and performance.