Skip to content

Commit

Permalink
Merge pull request #256 from astronomy-commons/sean/fix-typing
Browse files Browse the repository at this point in the history
Fix `from_healpix` typing
  • Loading branch information
smcguire-cmu authored Apr 11, 2024
2 parents e7b8f4c + fa26f66 commit 4a1d213
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/hipscat/pixel_tree/pixel_tree.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import List
from typing import List, Sequence

import numpy as np

Expand Down Expand Up @@ -87,11 +87,13 @@ def get_healpix_pixels(self) -> List[HealpixPixel]:
return np.vectorize(HealpixPixel)(self.pixels.T[0], self.pixels.T[1])

@classmethod
def from_healpix(cls, healpix_pixels: List[HealpixInputTypes], tree_order=None) -> PixelTree:
def from_healpix(cls, healpix_pixels: Sequence[HealpixInputTypes], tree_order=None) -> PixelTree:
"""Build a tree from a list of constituent healpix pixels
Args:
healpix_pixels: list of healpix pixels
tree_order (int): (Default = None) order to generate the tree at. If None, will use the highest
order from input pixels
Returns:
The pixel tree with the leaf pixels specified in the list
Expand Down
4 changes: 2 additions & 2 deletions src/hipscat/pixel_tree/pixel_tree_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List
from typing import Sequence

from hipscat.pixel_math.healpix_pixel_convertor import HealpixInputTypes
from hipscat.pixel_tree.pixel_tree import PixelTree
Expand All @@ -18,7 +18,7 @@ class PixelTreeBuilder:
"""

@staticmethod
def from_healpix(healpix_pixels: List[HealpixInputTypes]) -> PixelTree:
def from_healpix(healpix_pixels: Sequence[HealpixInputTypes]) -> PixelTree:
"""Build a tree from a list of constituent healpix pixels
Args:
Expand Down

0 comments on commit 4a1d213

Please sign in to comment.