File: registry.py

package info (click to toggle)
python-pint 0.24.4-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,924 kB
  • sloc: python: 19,983; makefile: 149
file content (28 lines) | stat: -rw-r--r-- 679 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
    pint.facets.numpy.registry
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    :copyright: 2022 by Pint Authors, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""


from __future__ import annotations

from typing import Any, Generic

from ...compat import TypeAlias
from ..plain import GenericPlainRegistry, QuantityT, UnitT
from .quantity import NumpyQuantity
from .unit import NumpyUnit


class GenericNumpyRegistry(
    Generic[QuantityT, UnitT], GenericPlainRegistry[QuantityT, UnitT]
):
    pass


class NumpyRegistry(GenericPlainRegistry[NumpyQuantity[Any], NumpyUnit]):
    Quantity: TypeAlias = NumpyQuantity[Any]
    Unit: TypeAlias = NumpyUnit