-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Numpy 2.0 support #205
Numpy 2.0 support #205
Conversation
tests/test_geometry.py
Outdated
pytest.importorskip( | ||
"phidl.font", reason="Testing of ttf/otf fonts requires the freetype package.", | ||
exc_type=ImportError, |
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.
This could go in a separate PR, and this might not be the correct solution.
https://docs.pytest.org/en/8.2.x/deprecations.html#import-or-skip-import-error
Thank you for the PR! I've made a few modifications to satisfy the tests but otherwise looks great! |
Thanks! I'm not sure why pre-commit was not catching these issues locally for me but oh well. Pour one out for Python 3.7 support. |
No idea what was going wrong on the 3.7 but it was EOL anyway! |
NumPy 2.0 is set to be released on June 16. I've been adding support in a couple other projects so figured I'd try to help out here if you're interested.
The process here was mainly to run the ruff plugin and fix what it caught. I used
np.float64
where I needed to pick a float precision, because that seemed more common in your code.I also added the optional dependencies I found when running tests as extras, so you can install them with
pip install phidl[all]
(or[test]
). Then I updated a few places that were causingDeprecationWarning
s.