-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add bool to allowed conversion between numpy arrays and RVec #18087
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
Conversation
Hi @vepadulano @dpiparo |
Test Results 18 files 18 suites 4d 10h 56m 31s ⏱️ Results for commit 1170796. ♻️ This comment has been updated with latest results. |
2c68a20
to
91f21cc
Compare
Hi @vepadulano , I have added 4 more types. |
bindings/pyroot/pythonizations/python/ROOT/_pythonization/_rvec.py
Outdated
Show resolved
Hide resolved
b5fe638
to
d2ec9dd
Compare
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 for addressing the issue! I left a minor comment inline, then I believe we need more tests in test/rvec_asrvec.py
. The list of dtypes in the AsRVec
test case class should be extended to include all the dtypes represented in the map after the changes.
bindings/pyroot/pythonizations/python/ROOT/_pythonization/_rvec.py
Outdated
Show resolved
Hide resolved
bindings/pyroot/pythonizations/python/ROOT/_pythonization/_rvec.py
Outdated
Show resolved
Hide resolved
bindings/pyroot/pythonizations/python/ROOT/_pythonization/_rvec.py
Outdated
Show resolved
Hide resolved
c3f6425
to
c69dd45
Compare
Add support for NumPy boolean type 'b1' in RVec conversion Modify _get_cpp_type_from_numpy_type in _rvec.py to map NumPy's 'b1'
c69dd45
to
1170796
Compare
Thank you for reverting back to the original change to fix the related issue @Aditya-138-12! I believe the extension of the type map was a good idea, but the issues that arose from it are unrelated to fixing the original problem and will need more careful attention, to be left for a follow-up PR 👍 |
Shouldn't short and unsigned short also be added here? |
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.
Thank you @Aditya-138-12 , LGTM!
Hi @lwpiotr ! Thanks for showing interest in this PR! As you can see from the previous comments, this was already attempted by the author, but different issues arose which are unrelated to the request from the user at the linked issue. In general, I agree this type conversion map could be further extended, but it is beyond the scope of this PR 👍 Feel free to propose a new PR to address the changes! |
@vepadulano Thank you for your time and guidance!! |
This Pull request:
Add support for NumPy boolean type 'b1' in RVec conversion
Changes or fixes:
Modify
_get_cpp_type_from_numpy_type
function in_rvec.py
to map NumPy's 'b1', thereby adding this in thedict cppytypes
"b1":"bool"
Checklist:
This PR fixes #18085