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

Addressed compatibility issue of OpenPNM with numpy 2.2 #2958

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

hpc-dave
Copy link
Contributor

@hpc-dave hpc-dave commented Feb 4, 2025

With NumPy 2.2, the reshape function signature has changed:
https://numpy.org/doc/stable/reference/generated/numpy.reshape.html
The provided array is now a positional-only argument and the newshape parameter is deprecated in favor of shape.

This affected the following files:

Fix:
Scanned the whole repository for affected calls, found and fixed following occurrences

  • removed the explicit assignment of temp to a in the reshape call in openpnm/_skygraph/queries/_funcs.py line 167
  • removed the newshape parameter and use positional arguments for compatibility of numpy versions in openpnm/_skygraph/queries/_funcs.py line 167 and openpnm/io/_pergeos.py line 178

Note:

  • pytest is currently failing due to updates in scipy 1.15,*, see discussions here and here

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.7%. Comparing base (18d004e) to head (cd0fc13).
Report is 8 commits behind head on dev.

Additional details and impacted files
@@          Coverage Diff          @@
##             dev   #2958   +/-   ##
=====================================
  Coverage   89.7%   89.7%           
=====================================
  Files        148     148           
  Lines       8662    8662           
=====================================
  Hits        7774    7774           
  Misses       888     888           

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.

1 participant