Skip to content

Commit b70a68b

Browse files
committed
fixes
1 parent 1e0a47f commit b70a68b

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

pixi.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ include = ["src"]
6363
pythonVersion = "3.13"
6464
pythonPlatform = "All"
6565
typeCheckingMode = "all"
66+
reportExplicitAny = false
6667

6768

6869
[tool.numpydoc_validation]

src/metrology_apis/__init__.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""Metrology APIs."""
22

33
from typing import (
4+
Any,
45
Final,
56
Protocol,
67
Self,
7-
TypeVar,
8+
TypeAlias,
89
override,
910
runtime_checkable,
1011
)
@@ -15,13 +16,13 @@
1516
__all__ = ["__version__", "Dimension", "Quantity", "Unit"]
1617

1718

18-
VT = TypeVar("VT")
19-
DT = TypeVar("DT", bound="Dimension")
20-
UT = TypeVar("UT", bound="Unit[DT]")
19+
VT: TypeAlias = Any
20+
DT: TypeAlias = Any
21+
UT: TypeAlias = Any
2122

2223

2324
@runtime_checkable
24-
class MetrologyNamespace[Q: Quantity[VT, UT, DT], V, U: Unit[DT], D: Dimension](
25+
class MetrologyNamespace[Q: Quantity[VT, UT, DT], V: VT, U: Unit[DT], D: Dimension](
2526
Protocol
2627
):
2728
@staticmethod
@@ -36,9 +37,9 @@ def asquantity(obj: Q | V, *, unit: U) -> Q: ...
3637

3738
@runtime_checkable
3839
class Dimension(Protocol):
39-
def __metrology_namespace__[Q: Quantity[VT, UT, DT], V, U: Unit[DT]](
40+
def __metrology_namespace__(
4041
self, /, *, api_version: str | None = None
41-
) -> MetrologyNamespace[Q, V, U, Self]:
42+
) -> MetrologyNamespace["Quantity[VT, UT, DT]", VT, "Unit[DT]", Self]:
4243
"""
4344
Return an object that has all the metrology API functions on it.
4445
@@ -61,6 +62,7 @@ def __metrology_namespace__[Q: Quantity[VT, UT, DT], V, U: Unit[DT]](
6162
names as well, but it is recommended to only include those
6263
names that are part of the specification.
6364
"""
65+
...
6466

6567
def __mul__(self, other: Self, /) -> Self: ...
6668
def __truediv__(self, other: Self, /) -> Self: ...
@@ -72,9 +74,9 @@ def __rtruediv__(self, other: Self, /) -> Self: ...
7274

7375
@runtime_checkable
7476
class Unit[D: Dimension](Protocol):
75-
def __metrology_namespace__[Q: Quantity[VT, UT, DT], V](
77+
def __metrology_namespace__(
7678
self, /, *, api_version: str | None = None
77-
) -> MetrologyNamespace[Q, V, Self, D]:
79+
) -> MetrologyNamespace["Quantity[VT, UT, DT]", VT, Self, D]:
7880
"""
7981
Return an object that has all the metrology API functions on it.
8082
@@ -97,6 +99,7 @@ def __metrology_namespace__[Q: Quantity[VT, UT, DT], V](
9799
it is recommended to only include those names that are part
98100
of the specification.
99101
"""
102+
...
100103

101104
@property
102105
def dimension(self) -> D: ...
@@ -136,6 +139,7 @@ def __metrology_namespace__(
136139
is recommended to only include those names that are part of the
137140
specification.
138141
"""
142+
...
139143

140144
@property
141145
def value(self) -> V: ...

0 commit comments

Comments
 (0)