Skip to content

Issues with hashing/saving QuadPrecDType #231

@dlakaplan

Description

@dlakaplan

Within PINT we currently need to be able to hash individual QuadPrecision values (for data integrity checks) and save arrays to npz files for rapid access. I don't think either of those currently work:

import numpy as np
from numpy_quaddtype import QuadPrecDType, QuadPrecision

hash(QuadPrecision(np.float32(2)))

fails (while hash(np.float128(2)) works using the native numpy type).

And:

d = np.array([1, 2, 3], dtype=QuadPrecDType)
np.savez('test.npz',d=d)

fails while the same for d=np.array([1,2,3],dtype=np.float128) works.

My hope is that these are both relatively easy fixes?

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