Table of Contents

Enum DTypeFlags

Namespace
NumSharp
Assembly
NumSharp.dll

Flags describing a DTypeMeta — the DType CLASS — under NumPy's own names, the NPY_DT_* bits of dtypemeta.h / dtype_api.h with NumPy's values (NPY_DT_LEGACY = 1, NPY_DT_ABSTRACT = 2, NPY_DT_PARAMETRIC = 4, NPY_DT_NUMERIC = 8), so a flags word compares bit for bit with NumPy's PyArray_DTypeMeta.flags.

[Flags]
public enum DTypeFlags

Fields

None = 0

No flags (the C# zero value; NumPy names no empty word).

NPY_DT_LEGACY = 1

NPY_DT_LEGACY: one of the builtin classes whose descriptor layout predates NEP 41/42 (every storage-backed NumSharp dtype and the datetime pair carry it; NEP 55's StringDType would not). Read in Python as DType._legacy.

NPY_DT_ABSTRACT = 2

NPY_DT_ABSTRACT: the class has no instances and exists only to take part in promotion — the NEP 50 Python-scalar classes _PyLongDType / _PyFloatDType / _PyComplexDType. Read in Python as DType._abstract.

NPY_DT_PARAMETRIC = 4

NPY_DT_PARAMETRIC: the instances carry parameters beyond the class (a datetime unit, a string length), so promote_types runs common_instance instead of returning the class default. Read in Python as DType._parametric.

NPY_DT_NUMERIC = 8

NPY_DT_NUMERIC (PyTypeNum_ISNUMBER): bool, the integers, the floats and complex. Read in Python as DType._is_numeric.

Remarks

The members keep NumPy's C spellings, as NPY_CASTING and NPY_TYPES do, because the NumPy surface of NumSharp is case-sensitive to NumPy. Python reads the same bits through the class attributes _legacy, _abstract, _parametric and _is_numeric, which DTypeMeta exposes under those names. None is the C# flags-enum zero; NumPy has no name for an empty word.