-
Notifications
You must be signed in to change notification settings - Fork 59
fix: Replace np.in1d with np.isin #4769
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
base: main
Are you sure you want to change the base?
Conversation
|
All Contributor License Agreement (CLA) signatures have been captured successfully. Thanks for contributing! |
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.
Pull request overview
This PR updates the codebase to replace the deprecated np.in1d function with np.isin to maintain compatibility with NumPy 2.4.0 and later versions, where np.in1d has been removed.
- Single function call replacement from
np.in1dtonp.isinin the mesh connectivity processing logic - Follows NumPy's official migration recommendation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@prmukherj Has anyone looked into this change on our side? |
@seanpearsonuk, yes. Waiting for your and @mkundu1's view on this, but according to official docs it is fine and it does not affect the working as well. |
OK I have enabled the workflows. |
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Context
np.in1dhas been removed as of NumPy 2.4.0, and thusget_connectivitycalls fail with NumPy >= 2.4. This PR fixes the corresponding issue #4768 where this was reported.Change Summary
np.isinis a direct replacement, and so has been substituted for the singlenp.in1dcall I could find in the code.Rationale
This substitution follows the recommendation of the NumPy documentation:
Impact
Restores the functionality of reading the mesh using
CaseFileas described in https://fluent.docs.pyansys.com/version/stable/user_guide/offline/case_file.html.