-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix KnotVector to numpy array conversion #453
Conversation
WalkthroughThe recent updates enhance the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (2)
- src/py/py_knot_vector.cpp (1 hunks)
- third_party/pybind11 (1 hunks)
Additional comments not posted (2)
third_party/pybind11 (1)
1-1
: Dependency update acknowledged.The subproject commit update for
pybind11
ensures the project benefits from the latest improvements and fixes from the library. Ensure compatibility with the rest of the codebase.src/py/py_knot_vector.cpp (1)
173-175
: Update to__array__
method acknowledged.The addition of
copy_ignored
as a keyword argument aligns with the changes in numpy 2.0. The function's logic remains unchanged, maintaining compatibility with numpy's interface.Ensure that the usage of this method is consistent across the codebase.
Run the following script to verify the function usage:
Verification successful
No additional calls to
__array__
method found.The
__array__
method is not called elsewhere in the codebase, so there are no inconsistencies in its usage. The implementation insrc/py/py_knot_vector.cpp
is the only occurrence.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `__array__` method in the codebase. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type cpp -A 5 $'__array__'Length of output: 483
Script:
#!/bin/bash # Description: Search for calls to the `__array__` method in the codebase to ensure consistent usage of the new signature. # Test: Search for calls to the `__array__` method. Expect: Consistent usage with the new signature. rg --type cpp '__array__'Length of output: 74
Thanks for the quick fix. Tests now work again. Looks good to me. |
I also checked the examples, and they are still working as expected. So there is no impact there either. |
Overview
Since numpy 2.0, a
copy
kwarg was added tonumpy.ndarray.__array__
. This PR adds**kwargs
to__array__
function. It is ignored, since we always return a copy.Addressed issues
Checklists
Summary by CodeRabbit
__array__
method in theKnotVector
class to accept additional keyword arguments, preparing for future enhancements.pybind11
dependency to a newer commit, potentially introducing bug fixes and performance improvements.