-
Notifications
You must be signed in to change notification settings - Fork 40
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
Unable to directly call np.ones
on user_type
#519
Comments
much of the functions I added were me trying to get Python to crash in a specific way. I failed, which is a good thing, because it means that EigenPy doesn't have the bug I thought it does. BUT. EigenPy *does* have two issues exercised in the unit tests for the custom type, issues stack-of-tasks#519 and stack-of-tasks#520 . Additionally, this code exercises issue stack-of-tasks#521 , where I try to compute vector norms in two different ways and fail. Additionally, I bumped the C++ standard to C++14, since Boost 1.87 didn't work correctly with only C++11, and 1.87 is now distributed by homebrew (I develop on a Mac)
This is working perfectly on my side with Numpy 2.2.0. Which version do of Numpy do you use? |
Thanks for looking into it. I am on Numpy 2.2.0 also, using Python 3.13 on MacOS on an M3 Max, and it's still failing, with the same error. I freshly built Eigenpy, then ran the I wonder if I have environment weirdness going right now, with Eigenpy and numpy installed from both Homebrew and pip. I'll do some investigation. |
I made a fresh environment and uninstalled all eigenpy's, etc. I believe I can confidently report that it wasn't my environment causing it to still fail for me. Freshly built eigenpy nowhere else installed on my system, Numpy 2.2.1 from pip, Python 3.13.1 from homebrew, Apple clang version 16.0.0, MacOS 15.2. Still failing the test with failing line (had to add in to the eigenpy test file
and if I dig a bit, the same error message as before
|
Following up a bit as I was trying to distill what you and I are doing differently, the difference between your code in #525 which works correctly, and mine in this thread, is the creation of an intermediate object. I find it problematic to have to remember to create an intermediate object, as I am a forgetful person.
I think I should be able to make an array of ones of
|
Doing a stepthrough in
I wonder if fixing the ability to make empty arrays of |
No. (I hope it's ok I document my thought process as we work through this issue -- it leaves a searchable trail, which I find very valuable) |
I've found the "bug". I think this is an internal issue of NumPy which assumes that the I've fixed the current issue in #525. |
Solved via #525 |
Using the Eigenpy-provided
user_type.cpp
, one is unable to directly make np arrays of ones / zeros.In
test_user_type.py
, changing lineto
causes the test to fail with error
The text was updated successfully, but these errors were encountered: