Skip to content

[pyhdc] Numpy array in Fortran layout is interpreted as C layout? #5

Description

@maarten-ic

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 ?!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions