incomplete support of numpy types
Hi,
Current code does not support bool_, void and complex types. This causes issues when encoding certain dtype-s (e.g. from h5py files).
Adding the following lines will resolve the issue:
elif isinstance(obj,(np.complex_,np.complex64,np.complex128)):
return {'real': obj.real, 'imag': obj.imag}
elif isinstance(obj, (np.bool_)):
return bool(obj)
elif isinstance(obj, (np.void)):
return None
Thanks for your suggestion. Sorry it has taken so long to get around to this. I'm going to work on implementing this now.
Changes implemented and project moved to v0.2.0.
Thank you !
On Fri, 24 Apr 2020, 8:32 Hunter Allen, [email protected] wrote:
Closed #1 https://github.com/hmallen/numpyencoder/issues/1.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hmallen/numpyencoder/issues/1#event-3267898113, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH3Q4OXSGCFM3JMBL6J42TROEP6TANCNFSM4ID2AT7A .