-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
BUG: Compatibility with numpy 1.16.x #178
Comments
This appears to be solvable in a non-ideal fashion by replacing The optimal solution would be to build the mapping from import numpy as np
from numpy.ctypeslib import as_ctypes_type
ctypes_to_dtypes = {}
for tp in set(np.sctypeDict.values()):
try:
ctype_for = as_ctypes_type(tp)
ctypes_to_dtypes[ctype_for] = tp
except NotImplementedError:
continue This yields: {ctypes.c_long: numpy.int32,
ctypes.c_ushort: numpy.uint16,
ctypes.c_ulonglong: numpy.uint64,
ctypes.c_longlong: numpy.int64,
ctypes.c_ubyte: numpy.uint8,
ctypes.c_byte: numpy.int8,
ctypes.c_double: numpy.float64,
ctypes.c_float: numpy.float32,
ctypes.c_short: numpy.int16,
ctypes.c_bool: numpy.bool_,
ctypes.c_ulong: numpy.uint32} Were there other types supported previously that are missing from this? |
May I ask, when will this fix be merged? |
If there are no other types to add support for, I can write a short patch to add this behavior. At the time I posted this solution, I thought that the repository had been abandoned. |
I thought too, but I can still see the new mergers although no new release for a long time. |
comtypes not working with numpy 1.16.x due to PR numpy/numpy#12769
automation.py and safearray.py reference
numpy.ctypeslib._typecodes
which is removed in that PRThe text was updated successfully, but these errors were encountered: