Skip to content

Commit f4fa6e6

Browse files
committed
tweaks
1 parent a500c69 commit f4fa6e6

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

src/metrology_apis/__init__.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def asquantity(obj: Q | V, *, unit: U) -> Q: ...
2323

2424
@runtime_checkable
2525
class Dimension(Protocol):
26-
def __metrology_namespace__[Q: Quantity, U: Unit](
26+
def __metrology_namespace__[Q: Quantity[V, U, Self], V, U: Unit[Self]](
2727
self, /, *, api_version: str | None = None
2828
) -> MetrologyNamespace[Q, U, Self]:
2929
"""
@@ -101,64 +101,64 @@ def unit(self) -> U: ...
101101

102102
@override
103103
def __eq__[B]( # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
104-
self: "Quantity[V, U]", other: "Quantity[op.CanEq[V, B], U]", /
104+
self: "Quantity[V, U, D]", other: "Quantity[op.CanEq[V, B], U, D]", /
105105
) -> B: ...
106106

107107
@override
108108
def __ne__[B]( # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
109-
self: "Quantity[V, U]", other: "Quantity[op.CanEq[V, B], U]", /
109+
self: "Quantity[V, U, D]", other: "Quantity[op.CanEq[V, B], U, D]", /
110110
) -> B: ...
111111

112112
def __lt__[B](
113-
self: "Quantity[V, U]", other: "Quantity[op.CanLt[V, B], U]", /
113+
self: "Quantity[V, U, D]", other: "Quantity[op.CanLt[V, B], U, D]", /
114114
) -> B: ...
115115
def __le__[B](
116-
self: "Quantity[V, U]", other: "Quantity[op.CanLe[V, B], U]", /
116+
self: "Quantity[V, U, D]", other: "Quantity[op.CanLe[V, B], U, D]", /
117117
) -> B: ...
118118
def __gt__[B](
119-
self: "Quantity[V, U]", other: "Quantity[op.CanGt[V, B], U]", /
119+
self: "Quantity[V, U, D]", other: "Quantity[op.CanGt[V, B], U, D]", /
120120
) -> B: ...
121121
def __ge__[B](
122-
self: "Quantity[V, U]", other: "Quantity[op.CanGe[V, B], U]", /
122+
self: "Quantity[V, U, D]", other: "Quantity[op.CanGe[V, B], U, D]", /
123123
) -> B: ...
124124

125-
def __pos__[R](self: "Quantity[op.CanPos[R], U]") -> "Quantity[R, U]": ...
126-
def __neg__[R](self: "Quantity[op.CanNeg[R], U]") -> "Quantity[R, U]": ...
127-
def __abs__[R](self: "Quantity[op.CanAbs[R], U]") -> "Quantity[R, U]": ...
125+
def __pos__[R](self: "Quantity[op.CanPos[R], U, D]") -> "Quantity[R, U, D]": ...
126+
def __neg__[R](self: "Quantity[op.CanNeg[R], U, D]") -> "Quantity[R, U, D]": ...
127+
def __abs__[R](self: "Quantity[op.CanAbs[R], U, D]") -> "Quantity[R, U, D]": ...
128128

129129
def __add__[R](
130-
self: "Quantity[V, U]", other: "Quantity[op.CanRAdd[V, R], U]", /
131-
) -> "Quantity[R, U]": ...
130+
self: "Quantity[V, U, D]", other: "Quantity[op.CanRAdd[V, R], U, D]", /
131+
) -> "Quantity[R, U, D]": ...
132132
def __radd__[R](
133-
self: "Quantity[V, U]", other: "Quantity[op.CanAdd[V, R], U]", /
134-
) -> "Quantity[R, U]": ...
133+
self: "Quantity[V, U, D]", other: "Quantity[op.CanAdd[V, R], U, D]", /
134+
) -> "Quantity[R, U, D]": ...
135135
def __sub__[R](
136-
self: "Quantity[V, U]", other: "Quantity[op.CanRSub[V, R], U]", /
137-
) -> "Quantity[R, U]": ...
136+
self: "Quantity[V, U, D]", other: "Quantity[op.CanRSub[V, R], U, D]", /
137+
) -> "Quantity[R, U, D]": ...
138138
def __rsub__[R](
139-
self: "Quantity[V, U]", other: "Quantity[op.CanSub[V, R], U]", /
140-
) -> "Quantity[R, U]": ...
139+
self: "Quantity[V, U, D]", other: "Quantity[op.CanSub[V, R], U, D]", /
140+
) -> "Quantity[R, U, D]": ...
141141

142142
def __mul__[R](
143-
self: "Quantity[V, U]", other: "Quantity[op.CanRMul[V, R], U]", /
144-
) -> "Quantity[R, U]": ...
143+
self: "Quantity[V, U, D]", other: "Quantity[op.CanRMul[V, R], U, D]", /
144+
) -> "Quantity[R, U, D]": ...
145145
def __rmul__[R](
146-
self: "Quantity[V, U]", other: "Quantity[op.CanMul[V, R], U]", /
147-
) -> "Quantity[R, U]": ...
146+
self: "Quantity[V, U, D]", other: "Quantity[op.CanMul[V, R], U, D]", /
147+
) -> "Quantity[R, U, D]": ...
148148
def __truediv__[R](
149-
self: "Quantity[V, U]", other: "Quantity[op.CanRTruediv[V, R], U]", /
150-
) -> "Quantity[R, U]": ...
149+
self: "Quantity[V, U, D]", other: "Quantity[op.CanRTruediv[V, R], U, D]", /
150+
) -> "Quantity[R, U, D]": ...
151151
def __rtruediv__[R](
152-
self: "Quantity[V, U]", other: "Quantity[op.CanTruediv[V, R], U]", /
153-
) -> "Quantity[R, U]": ...
152+
self: "Quantity[V, U, D]", other: "Quantity[op.CanTruediv[V, R], U, D]", /
153+
) -> "Quantity[R, U, D]": ...
154154

155155
def __pow__[R](
156-
self: "Quantity[op.CanPow2[op.JustInt | op.JustFloat, R], U]",
156+
self: "Quantity[op.CanPow2[op.JustInt | op.JustFloat, R], U, D]",
157157
other: op.JustInt | op.JustFloat,
158158
/,
159-
) -> "Quantity[R, U]": ...
159+
) -> "Quantity[R, U, D]": ...
160160
def __rpow__[R](
161-
self: "Quantity[op.CanRPow[op.JustInt | op.JustFloat, R], U]",
161+
self: "Quantity[op.CanRPow[op.JustInt | op.JustFloat, R], U, D]",
162162
other: op.JustInt | op.JustFloat,
163163
/,
164-
) -> "Quantity[R, U]": ...
164+
) -> "Quantity[R, U, D]": ...

0 commit comments

Comments
 (0)