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

Resolve PyNumero incompatibilities with NumPy2 #3408

Merged
merged 21 commits into from
Nov 7, 2024
Merged

Conversation

jsiirola
Copy link
Member

@jsiirola jsiirola commented Nov 7, 2024

Fixes # .

Summary/Motivation:

This resolves some incompatibilities between PyNumero and NumPy>=2, and should resolve the last of the test failures in #3401.

Changes proposed in this PR:

  • Some PyNumero tests were missing guards for networkx
  • NumPy2 no longer supports ndarray.ptp: remove that from the PyNumero BlockVector API when running with NumPy2
  • NumPy2's implementation of numpy.ptp performs vector reductions (using the reduce ufunc method). Update BlockVector to support (a limited set of) ufunc.reduce()
  • Start to clean up some of the logic in BlockVector.__arrau_ufunc__ (and helper functions)
  • Add a new GHA test that should exercise pynumero with numpy2 (at least until dependencies for the the main GHA jobs allow installation of NumPy2)

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@blnicho blnicho merged commit 5e9b0f2 into Pyomo:main Nov 7, 2024
33 checks passed
@jsiirola jsiirola deleted the numpy2 branch November 7, 2024 20:53
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.

3 participants