Skip to content

Commit 3b5b499

Browse files
committed
[mypy] specify error code to ignore
1 parent 9118678 commit 3b5b499

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

quantities/dimensionality.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Dimensionality(dict):
2424
...
2525

2626

27-
def __hash__(self) -> int: # type: ignore
27+
def __hash__(self) -> int: # type: ignore[override]
2828
...
2929

3030
def __add__(self, other: Dimensionality) -> Dimensionality:

quantities/quantity.pyi

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ from quantities.typing.quantities import DimensionalityDescriptor, QuantityData
55
import numpy.typing as npt
66

77

8-
def validate_unit_quantity(value: Quantity) -> Quantity: #type: ignore
8+
def validate_unit_quantity(value: Quantity) -> Quantity:
99
...
1010

1111

@@ -39,12 +39,12 @@ class Quantity(npt.NDArray):
3939
def magnitude(self) -> npt.NDArray:
4040
...
4141

42-
@property #type: ignore
43-
def real(self) -> Quantity: #type: ignore
42+
@property # type: ignore[misc]
43+
def real(self) -> Quantity: # type: ignore[override]
4444
...
4545

46-
@property #type: ignore
47-
def imag(self) -> Quantity: #type: ignore
46+
@property # type: ignore[misc]
47+
def imag(self) -> Quantity: # type: ignore[override]
4848
...
4949

5050
@property
@@ -67,15 +67,15 @@ class Quantity(npt.NDArray):
6767
...
6868

6969

70-
def __sub__(self, other) -> Quantity: #type: ignore
70+
def __sub__(self, other) -> Quantity: # type: ignore[override]
7171
...
7272

7373

74-
def __rsub__(self, other) -> Quantity: #type: ignore
74+
def __rsub__(self, other) -> Quantity: # type: ignore[override]
7575
...
7676

7777

78-
def __isub__(self, other) -> Quantity: #type: ignore
78+
def __isub__(self, other) -> Quantity: # type: ignore[override]
7979
...
8080

8181
def __mod__(self, other) -> Quantity:
@@ -94,7 +94,7 @@ class Quantity(npt.NDArray):
9494
# ...
9595

9696

97-
def __rtruediv__(self, other) -> Quantity: #type: ignore
97+
def __rtruediv__(self, other) -> Quantity: # type: ignore[override]
9898
...
9999

100100
def __pow__(self, power) -> Quantity:

quantities/uncertainquantity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __new__(cls, data, units='', uncertainty=None, dtype='d', copy=True):
2727

2828
return ret
2929

30-
@Quantity.units.setter #type: ignore
30+
@Quantity.units.setter # type: ignore[attr-defined]
3131
def units(self, units):
3232
super()._set_units(units)
3333
self.uncertainty.units = self._dimensionality

0 commit comments

Comments
 (0)