From 3d88ea45e577df441956a7736bdf5e294664e350 Mon Sep 17 00:00:00 2001 From: Omar Abdelgawad Date: Sat, 27 Jul 2024 04:29:10 +0300 Subject: [PATCH] removed slots and numpy.floating (#810) --- invesalius/gui/widgets/clut_imagedata.py | 2 +- invesalius/gui/widgets/clut_raycasting.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/invesalius/gui/widgets/clut_imagedata.py b/invesalius/gui/widgets/clut_imagedata.py index 21091fe2b..57824342a 100644 --- a/invesalius/gui/widgets/clut_imagedata.py +++ b/invesalius/gui/widgets/clut_imagedata.py @@ -25,7 +25,7 @@ PADDING = 2 -@dataclass(order=True, slots=True) +@dataclass(order=True) class Node: value: float colour: Tuple[int, int, int] = field(compare=False) diff --git a/invesalius/gui/widgets/clut_raycasting.py b/invesalius/gui/widgets/clut_raycasting.py index 8bb0a5a06..51a664b02 100644 --- a/invesalius/gui/widgets/clut_raycasting.py +++ b/invesalius/gui/widgets/clut_raycasting.py @@ -20,7 +20,7 @@ import bisect import math import os -from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Union +from typing import TYPE_CHECKING, Dict, Iterable, List, Optional, Tuple, Union import numpy import wx @@ -348,7 +348,7 @@ def _has_clicked_in_a_point( def distance_from_point_line( self, p1: Tuple[float, float], p2: Tuple[float, float], pc: Tuple[float, float] - ) -> numpy.floating[Any]: + ) -> float: """ Calculate the distance from point pc to a line formed by p1 and p2. """ @@ -362,7 +362,7 @@ def distance_from_point_line( theta = math.acos(numpy.dot(A, B) / (len_A * len_B)) # Using the sin from theta, calculate the adjacent leg, which is the # distance from the point to the line - distance = math.sin(theta) * len_A + distance = float(math.sin(theta) * len_A) return distance def _has_clicked_in_selection_curve(self, position: "SupportsGetItem[float]") -> Optional[int]: