-
Notifications
You must be signed in to change notification settings - Fork 748
NumPy Float64 not being passed correctly #90
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
Comments
Executing the same code using Win32COM does not produce an error either. |
can you show minimal example and how you figured out that type is changed? do examples on this page work for you? |
Just saw the
But the same example using |
@vmuriart I could replicate your problem:
But:
returns:
|
@tonyroberts how can this issue be debugged? is this failing in the weird IL code? |
@denfromufa just search for the error in the code (it's in converter.cs) and it might be fairly clear what's going on just from looking at the code immediately before the error. Otherwise, set a breakpoint where the error is being set, attach the visual studio debugger to your python process and run the python code and work back from there. In this case I imagine that the C# code is checking for an exact type match with 'float' which is failing for np.double. If that is the case, changing it to an 'isinstance' style check instead would fix it I would think. |
Pardon my low level of understanding. I surveyed the code, and from what I think I understand, on |
to be more precise numpy double fails here:
call stack
locals
auto
|
to make |
That sounds logical. I tried to look at how pywin32 handles the conversion, but their source isn't as navigation friendly. Have you tested to see if any of the other numpy objects break as well? |
Yep, bunch of them break, |
I did not find how pywin32 works, but this document shows mapping between |
This seems to be fixed. |
Possibly related to #86. When passing a
numpy float64
to a dll library using PythonNet, the object type changes (not sure to what type).I have tried to reproduce the error on the dll directly, by passing the same value with different types and it works as expected. Any ideas?
The text was updated successfully, but these errors were encountered: