Skip to content

ENH: np.finfo support for Numpy User DTypes #27231

@SwayamInSync

Description

@SwayamInSync

Proposed new feature or change:

Require the support for integrating User DTypes with numpy.finfo as currently it raises the ValueError

In [2]: np.finfo(QuadPrecDType)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[2], line 1
----> 1 np.finfo(QuadPrecDType)

File ~/Desktop/numpy-user-dtypes/quaddtype/.venv/lib/python3.11/site-packages/numpy/_core/getlimits.py:519, in finfo.__new__(cls, dtype)
    517     dtype = newdtype
    518 if not issubclass(dtype, numeric.inexact):
--> 519     raise ValueError("data type %r not inexact" % (dtype))
    520 obj = cls._finfo_cache.get(dtype)
    521 if obj is not None:

ValueError: data type <class 'numpy.object_'> not inexact

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions