Skip to content

Commit

Permalink
use numba isclose
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc2 committed Sep 18, 2024
1 parent 861c8f7 commit 064a465
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions uxarray/grid/intersections.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from uxarray.grid.arcs import point_within_gca, extreme_gca_latitude, in_between
import platform
import warnings
from uxarray.utils.computing import cross_fma, allclose, dot, cross, norm
from uxarray.utils.computing import cross_fma, allclose, dot, cross, norm, isclose

from uxarray.constants import ENABLE_FMA

Expand Down Expand Up @@ -161,10 +161,10 @@ def gca_constLat_intersection(gca_cart, constZ, verbose=False, is_directed=False
# We are using the relative tolerance and ERROR_TOLERANCE since the constZ is calculated from np.sin, which
# may have some floating-point error.
res = None
if np.isclose(x1[2], constZ, rtol=ERROR_TOLERANCE, atol=ERROR_TOLERANCE):
if isclose(x1[2], constZ, rtol=ERROR_TOLERANCE, atol=ERROR_TOLERANCE):
res = np.array([x1]) if res is None else np.vstack((res, x1))

if np.isclose(x2[2], constZ, rtol=ERROR_TOLERANCE, atol=ERROR_TOLERANCE):
if isclose(x2[2], constZ, rtol=ERROR_TOLERANCE, atol=ERROR_TOLERANCE):
res = np.array([x2]) if res is None else np.vstack((res, x2))

if res is not None:
Expand Down

0 comments on commit 064a465

Please sign in to comment.