Skip to content

Commit

Permalink
fix(write_annotations): fix type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
jbms committed Jan 20, 2024
1 parent e43ed3c commit 9524a72
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions python/neuroglancer/write_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def __init__(
)
self.related_annotations = [{} for _ in self.relationships]

def add_point(self, point: Sequence[int], id: Optional[int] = None, **kwargs):
def add_point(self, point: Sequence[float], id: Optional[int] = None, **kwargs):
if self.annotation_type != "point":
raise ValueError(
f"Expected annotation type point, but received: {self.annotation_type}"
Expand All @@ -124,8 +124,8 @@ def add_point(self, point: Sequence[int], id: Optional[int] = None, **kwargs):

def add_axis_aligned_bounding_box(
self,
point_a: Sequence[int],
point_b: Sequence[int],
point_a: Sequence[float],
point_b: Sequence[float],
id: Optional[int] = None,
**kwargs,
):
Expand All @@ -137,8 +137,8 @@ def add_axis_aligned_bounding_box(

def add_line(
self,
point_a: Sequence[int],
point_b: Sequence[int],
point_a: Sequence[float],
point_b: Sequence[float],
id: Optional[int] = None,
**kwargs,
):
Expand All @@ -150,8 +150,8 @@ def add_line(

def _add_two_point_obj(
self,
point_a: Sequence[int],
point_b: Sequence[int],
point_a: Sequence[float],
point_b: Sequence[float],
id: Optional[int] = None,
**kwargs,
):
Expand All @@ -168,9 +168,9 @@ def _add_two_point_obj(
self.lower_bound = np.minimum(self.lower_bound, point_a)
self.upper_bound = np.maximum(self.upper_bound, point_b)
coords = np.concatenate((point_a, point_b))
self._add_obj(cast(Sequence[int], coords), id, **kwargs)
self._add_obj(cast(Sequence[float], coords), id, **kwargs)

def _add_obj(self, coords: Sequence[int], id: Optional[int], **kwargs):
def _add_obj(self, coords: Sequence[float], id: Optional[int], **kwargs):
encoded = np.zeros(shape=(), dtype=self.dtype)
encoded[()]["geometry"] = coords

Expand Down

0 comments on commit 9524a72

Please sign in to comment.