Skip to content

Commit 3fa6646

Browse files
committed
dtype_from_numpy: Add long alias
1 parent 4143acb commit 3fa6646

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

include/openPMD/binding/python/Numpy.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ inline Datatype dtype_from_numpy(pybind11::dtype const dt)
5858
return Datatype::INT;
5959
else if (dt.char_() == pybind11::dtype("int_").char_())
6060
return Datatype::LONG;
61+
else if (dt.char_() == pybind11::dtype("long").char_()) // alias used on Win64
62+
return Datatype::LONG;
6163
else if (dt.char_() == pybind11::dtype("longlong").char_())
6264
return Datatype::LONGLONG;
6365
else if (dt.char_() == pybind11::dtype("ushort").char_())
@@ -66,6 +68,8 @@ inline Datatype dtype_from_numpy(pybind11::dtype const dt)
6668
return Datatype::UINT;
6769
else if (dt.char_() == pybind11::dtype("uint").char_())
6870
return Datatype::ULONG;
71+
else if (dt.char_() == pybind11::dtype("ulong").char_()) // alias used on Win64
72+
return Datatype::ULONG;
6973
else if (dt.char_() == pybind11::dtype("ulonglong").char_())
7074
return Datatype::ULONGLONG;
7175
else if (dt.char_() == pybind11::dtype("clongdouble").char_())

0 commit comments

Comments
 (0)