From a5fde55217b8326c421e5280855100c6c33fc825 Mon Sep 17 00:00:00 2001 From: Carlos Adir Date: Sun, 26 Oct 2025 21:41:26 +0100 Subject: [PATCH 1/2] fix unary format problem due to bad operand --- src/shapepy/geometry/point.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/shapepy/geometry/point.py b/src/shapepy/geometry/point.py index 429cb8ab..633fcc22 100644 --- a/src/shapepy/geometry/point.py +++ b/src/shapepy/geometry/point.py @@ -57,7 +57,7 @@ def __init__( self.__angle = angle @property - def xcoord(self) -> Real: + def xcoord(self) -> float: """The horizontal coordinate of the point""" if self.__xcoord is None: cos = self.__angle.cos() @@ -65,7 +65,7 @@ def xcoord(self) -> Real: return self.__xcoord @property - def ycoord(self) -> Real: + def ycoord(self) -> float: """The vertical coordinate of the point""" if self.__ycoord is None: sin = self.__angle.sin() @@ -73,7 +73,7 @@ def ycoord(self) -> Real: return self.__ycoord @property - def radius(self) -> Real: + def radius(self) -> float: """The norm L2 of the point: sqrt(x*x + y*y)""" if self.__radius is None: self.__radius = Math.sqrt(self.__xcoord**2 + self.__ycoord**2) @@ -114,10 +114,10 @@ def __eq__(self, other: Point2D) -> bool: def __neg__(self) -> Point2D: return self.__class__( - -self.xcoord, - -self.ycoord, + -1 * self.xcoord, + -1 * self.ycoord, self.radius, - ~self.angle, + self.angle.__invert__(), ) def __pos__(self) -> Point2D: From 3b0a86dd88789e5057ac76912f8b929b403cdd31 Mon Sep 17 00:00:00 2001 From: Carlos Adir Date: Sun, 26 Oct 2025 21:47:04 +0100 Subject: [PATCH 2/2] revert annotation change --- src/shapepy/geometry/point.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shapepy/geometry/point.py b/src/shapepy/geometry/point.py index 633fcc22..102e972d 100644 --- a/src/shapepy/geometry/point.py +++ b/src/shapepy/geometry/point.py @@ -57,7 +57,7 @@ def __init__( self.__angle = angle @property - def xcoord(self) -> float: + def xcoord(self) -> Real: """The horizontal coordinate of the point""" if self.__xcoord is None: cos = self.__angle.cos() @@ -65,7 +65,7 @@ def xcoord(self) -> float: return self.__xcoord @property - def ycoord(self) -> float: + def ycoord(self) -> Real: """The vertical coordinate of the point""" if self.__ycoord is None: sin = self.__angle.sin() @@ -73,7 +73,7 @@ def ycoord(self) -> float: return self.__ycoord @property - def radius(self) -> float: + def radius(self) -> Real: """The norm L2 of the point: sqrt(x*x + y*y)""" if self.__radius is None: self.__radius = Math.sqrt(self.__xcoord**2 + self.__ycoord**2)