Skip to content

Commit 7a103da

Browse files
committed
use numba jit compilation
1 parent 4ef9952 commit 7a103da

File tree

3 files changed

+6
-27
lines changed

3 files changed

+6
-27
lines changed

src/hats/pixel_math/margin_bounding.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def check_margin_bounds(r_asc, dec, pixel_order, pixel, margin_threshold, step=1
9090

9191

9292
# numba jit compiler doesn't count for coverage tests, so we'll set no cover.
93-
@njit("double(double[:], double[:], double)")
93+
@njit
9494
def _find_minimum_distance(separations, distances, margin_threshold): # pragma: no cover
9595
"""Find the minimum distance between a given datapoint and a healpixel"""
9696
minimum_index = np.argmin(separations)

src/hats/pixel_tree/moc_filter.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ def filter_by_moc(
2626
return PixelTree(tree.tree[tree_mask], tree.tree_order)
2727

2828

29-
@njit(
30-
numba.bool_[::1](
31-
numba.int64[:, :],
32-
numba.uint64[:, :],
33-
)
34-
)
29+
@njit
3530
def perform_filter_by_moc(
3631
tree: np.ndarray,
3732
moc: np.ndarray,

src/hats/pixel_tree/pixel_alignment.py

+4-20
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def get_pixel_mapping_df(mapping: np.ndarray, map_order: int) -> pd.DataFrame:
141141

142142

143143
# pylint: disable=too-many-statements
144-
@njit(numba.int64[::1, :](numba.int64[:, :], numba.int64[:, :]))
144+
@njit
145145
def perform_inner_align_trees(
146146
left: np.ndarray,
147147
right: np.ndarray,
@@ -208,15 +208,7 @@ def perform_inner_align_trees(
208208
return mapping[:out_index].T
209209

210210

211-
@njit(
212-
numba.types.void(
213-
numba.int64,
214-
numba.int64,
215-
numba.int64[:],
216-
numba.boolean,
217-
numba.types.List(numba.int64[::1]),
218-
)
219-
)
211+
@njit
220212
def _add_pixels_until(
221213
add_from: int,
222214
add_to: int,
@@ -259,15 +251,7 @@ def _add_pixels_until(
259251
add_from = add_from + pixel_size
260252

261253

262-
@njit(
263-
numba.types.void(
264-
numba.int64,
265-
numba.int64[:, :],
266-
numba.int64,
267-
numba.boolean,
268-
numba.types.List(numba.int64[::1]),
269-
)
270-
)
254+
@njit
271255
def _add_remaining_pixels(
272256
added_until: int,
273257
pixel_list: np.ndarray,
@@ -303,7 +287,7 @@ def _add_remaining_pixels(
303287

304288

305289
# pylint: disable=too-many-statements
306-
@njit(numba.types.List(numba.int64[::1])(numba.int64[:, :], numba.int64[:, :], numba.boolean, numba.boolean))
290+
@njit
307291
def perform_align_trees(
308292
left: np.ndarray,
309293
right: np.ndarray,

0 commit comments

Comments
 (0)