Skip to content
Snippets Groups Projects
Commit 8d2644b8 authored by Leon Teichrob's avatar Leon Teichrob
Browse files

Fixed bug in python bindings for Fortran-ordered input arrays, e.g. when transposing.

parent 58798e5c
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,10 @@ class STEAM_materials: ...@@ -66,7 +66,10 @@ class STEAM_materials:
:param numpy2d: Numpy array with number of columns corresponding to number of function arguments and points to evaluate in rows :param numpy2d: Numpy array with number of columns corresponding to number of function arguments and points to evaluate in rows
:return: Numpy array with values calculated by .dll function :return: Numpy array with values calculated by .dll function
""" """
numpy2d = np.array(numpy2d, dtype=np.float64) if not isinstance(numpy2d, np.ndarray):
numpy2d = np.array(numpy2d, dtype=np.float64, order='C')
else:
numpy2d = np.ascontiguousarray(numpy2d, dtype=np.float64)
inReal = (numpy2d.__array_interface__['data'][0] + np.arange(numpy2d.shape[0]) * numpy2d.strides[0]).astype(np.uintp) inReal = (numpy2d.__array_interface__['data'][0] + np.arange(numpy2d.shape[0]) * numpy2d.strides[0]).astype(np.uintp)
error_out = self.eval(self.func_name, self.n_arg, inReal, inReal, self.n_points, self.RealPtr, self.Int_Ptr) error_out = self.eval(self.func_name, self.n_arg, inReal, inReal, self.n_points, self.RealPtr, self.Int_Ptr)
if error_out == 1: if error_out == 1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment