Skip to content

Commit dc075d4

Browse files
committed
replace numbers.Number with int, float
1 parent d7e9481 commit dc075d4

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

funlib/geometry/coordinate.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __neg__(self) -> "Coordinate":
6363
def __abs__(self) -> "Coordinate":
6464
return Coordinate(abs(a) if a is not None else None for a in self)
6565

66-
def __add__(self, other: Union[Any, "Coordinate", numbers.Number]) -> "Coordinate":
66+
def __add__(self, other: Union[Any, "Coordinate", int, float]) -> "Coordinate":
6767
if isinstance(other, Coordinate):
6868
assert (
6969
self.dims == other.dims
@@ -81,7 +81,7 @@ def __add__(self, other: Union[Any, "Coordinate", numbers.Number]) -> "Coordinat
8181
"addition of Coordinate with type %s not supported" % type(other)
8282
)
8383

84-
def __sub__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinate":
84+
def __sub__(self, other: Union["Coordinate", int, float]) -> "Coordinate":
8585
if isinstance(other, Coordinate):
8686
assert (
8787
self.dims == other.dims
@@ -99,7 +99,7 @@ def __sub__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinate":
9999
"subtraction of Coordinate with type %s not supported" % type(other)
100100
)
101101

102-
def __mul__(self, other: Union[Any, "Coordinate", numbers.Number]) -> "Coordinate":
102+
def __mul__(self, other: Union[Any, "Coordinate", int, float]) -> "Coordinate":
103103
if isinstance(other, Coordinate):
104104
assert (
105105
self.dims == other.dims
@@ -118,7 +118,7 @@ def __mul__(self, other: Union[Any, "Coordinate", numbers.Number]) -> "Coordinat
118118
"multiplication of Coordinate with type %s not supported" % type(other)
119119
)
120120

121-
def __div__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinate":
121+
def __div__(self, other: Union["Coordinate", int, float]) -> "Coordinate":
122122
if isinstance(other, Coordinate):
123123
assert (
124124
self.dims == other.dims
@@ -137,7 +137,7 @@ def __div__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinate":
137137
"division of Coordinate with type %s not supported" % type(other)
138138
)
139139

140-
def __truediv__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinate":
140+
def __truediv__(self, other: Union["Coordinate", int, float]) -> "Coordinate":
141141
if isinstance(other, Coordinate):
142142
assert (
143143
self.dims == other.dims
@@ -156,7 +156,7 @@ def __truediv__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinate
156156
"division of Coordinate with type %s not supported" % type(other)
157157
)
158158

159-
def __floordiv__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinate":
159+
def __floordiv__(self, other: Union["Coordinate", int, float]) -> "Coordinate":
160160
if isinstance(other, Coordinate):
161161
assert (
162162
self.dims == other.dims
@@ -175,7 +175,7 @@ def __floordiv__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinat
175175
"division of Coordinate with type %s not supported" % type(other)
176176
)
177177

178-
def __mod__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinate":
178+
def __mod__(self, other: Union["Coordinate", int, float]) -> "Coordinate":
179179
if isinstance(other, Coordinate):
180180
assert (
181181
self.dims == other.dims
@@ -194,7 +194,7 @@ def __mod__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinate":
194194
"mod of Coordinate with type %s not supported" % type(other)
195195
)
196196

197-
def __pow__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinate":
197+
def __pow__(self, other: Union["Coordinate", int, float]) -> "Coordinate":
198198
if isinstance(other, Coordinate):
199199
assert (
200200
self.dims == other.dims

0 commit comments

Comments
 (0)