-
Notifications
You must be signed in to change notification settings - Fork 36
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 in tests #997
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #997 +/- ##
=======================================
Coverage 86.01% 86.01%
=======================================
Files 20 20
Lines 3503 3503
Branches 770 770
=======================================
Hits 3013 3013
Misses 333 333
Partials 157 157 ☔ View full report in Codecov by Sentry. |
Test failures appear to be related to PyTables/PyTables#1172
|
Overall, our dependency on PyTables has been really hard to keep working. PyTables is usually the last of signac's dependencies to support new Python versions and such. I'd be okay with softening this dependency and not requiring it in our tests. Let me know if you want more specific input on that possibility. |
I see PyTables has a PR for fixing this, so I vote we wait a couple weeks and check back |
The latest pull request on PyTables refactors the CI and specifically pins numpy < 2. The numpy 2 support PR has been closed and a new one has been created by an outside contributor. It appears that we will be waiting MANY weeks, if not months. I suggest you update the signac tests to optionally skip pytables tests so that we can move forward. |
The tests already have pandas and tables in a separate list I considered making yet another list of requirements like
|
The failure to import pytables is a catchable The simplest fix is to use tables = pytest.importorskip("tables") in place of import tables https://docs.pytest.org/en/6.2.x/reference.html#pytest.importorskip However, it appears that exceptions other than The more complex alternative is try:
import tables
skip_tables = False
except ValueError:
skip_tables = True
skip_tables = pytest.mark.skipif(skip_tables,
reason="The tables package is non-functional.") Then, decorate individual test functions (and/or classes) that use tables with: @skip_tables |
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.
Thanks!
Description
Apply changes from https://numpy.org/doc/stable//numpy_2_0_migration_guide.html#changes-to-namespaces
Motivation and Context
Checklist: