Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed slots and numpy.floating #810

Merged
merged 1 commit into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading