[pyhdc] Numpy array in Fortran layout is interpreted as C layout?
Opened this issue · 0 comments
maarten-ic commented
When I assign a (2+D) numpy array in Fortran layout to a HDC container, the HDC library interprets this as a C layout array. The stored array then no longer matches the source array:
Reproduction:
import pyhdc
import numpy as np
c_array = np.arange(12).reshape((3,4))
hdc = pyhdc.HDC(c_array)
print(np.array_equal(hdc.to_python(), c_array)) # True
f_array = np.asfortranarray(c_array)
hdc = pyhdc.HDC(f_array)
print(np.array_equal(hdc.to_python(), f_array)) # False ?!