| 54 | |
| 55 | |
| 56 | def _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 | |
| 77 | def _get_extended_precision_list() -> list[str]: |