Skip to content

Commit

Permalink
Add support for specifying healpix order
Browse files Browse the repository at this point in the history
  • Loading branch information
MetinSa committed Apr 28, 2024
1 parent 53a1a1f commit a46cb20
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 95 deletions.
7 changes: 4 additions & 3 deletions tests/_strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import datetime
from functools import partial
from math import log2
from typing import Any, Callable, Sequence
from typing import Any, Callable, Literal, Sequence

import astropy.coordinates as coords
import astropy.units as u
Expand Down Expand Up @@ -71,8 +71,9 @@ def times(draw: DrawFn) -> time.Time:


@composite
def nsides(draw: Callable[[SearchStrategy[int]], int]) -> int:
return draw(integers(min_value=MIN_NSIDE_EXP, max_value=MAX_NSIDE_EXP).map(partial(pow, 2)))
def healpixes(draw: DrawFn, order: Literal["ring", "nested"] = "ring") -> hp.HEALPix:
nside = draw(integers(min_value=MIN_NSIDE_EXP, max_value=MAX_NSIDE_EXP).map(partial(pow, 2)))
return hp.HEALPix(nside=nside, order=order)


@composite
Expand Down
Loading

0 comments on commit a46cb20

Please sign in to comment.