MCPcopy Create free account
hub / github.com/numpy/numpy / _get_precision_dict

Function _get_precision_dict

numpy/typing/mypy_plugin.py:56–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54
55
56def _get_precision_dict() -> dict[str, str]:
57 names = [
58 ("_NBitByte", np.byte),
59 ("_NBitShort", np.short),
60 ("_NBitIntC", np.intc),
61 ("_NBitIntP", np.intp),
62 ("_NBitInt", np.int_),
63 ("_NBitLongLong", np.longlong),
64
65 ("_NBitHalf", np.half),
66 ("_NBitSingle", np.single),
67 ("_NBitDouble", np.double),
68 ("_NBitLongDouble", np.longdouble),
69 ]
70 ret = {}
71 for name, typ in names:
72 n: int = 8 * typ().dtype.itemsize
73 ret[f'numpy._typing._nbit.{name}'] = f"numpy._{n}Bit"
74 return ret
75
76
77def _get_extended_precision_list() -> list[str]:

Callers 1

mypy_plugin.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected