Skip to content

Commit

Permalink
replace numbers.Number with int, float
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonw committed Jan 3, 2024
1 parent d7e9481 commit dc075d4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions funlib/geometry/coordinate.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __neg__(self) -> "Coordinate":
def __abs__(self) -> "Coordinate":
return Coordinate(abs(a) if a is not None else None for a in self)

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

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

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

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

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

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

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

def __pow__(self, other: Union["Coordinate", numbers.Number]) -> "Coordinate":
def __pow__(self, other: Union["Coordinate", int, float]) -> "Coordinate":
if isinstance(other, Coordinate):
assert (
self.dims == other.dims
Expand Down

0 comments on commit dc075d4

Please sign in to comment.