Skip to content

Commit

Permalink
removed slots and numpy.floating (invesalius#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-abdelgawad authored Jul 27, 2024
1 parent 79a7775 commit 3d88ea4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion invesalius/gui/widgets/clut_imagedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions invesalius/gui/widgets/clut_raycasting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
"""
Expand All @@ -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]:
Expand Down

0 comments on commit 3d88ea4

Please sign in to comment.