Skip to content

Commit 09af68f

Browse files
committed
o reverting to max(-1.0, min(1.0, d_dot_norm)) as approach is the most reliable solution since it's simple, fast, and fully supported by Numba. Numba doesn't fully support np.clip in nopython mode.
1 parent 01a15f7 commit 09af68f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

uxarray/grid/dual.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def _order_nodes(
238238
d_dot_norm = np.dot(node_zero, node_diff) / (node_zero_mag * node_diff_mag)
239239

240240
# Clamp to valid range for arccos to avoid numerical errors
241-
d_dot_norm = np.clip(d_dot_norm, -1.0, 1.0)
241+
d_dot_norm = max(-1.0, min(1.0, d_dot_norm))
242242

243243
d_angles[j] = np.arccos(d_dot_norm)
244244

0 commit comments

Comments
 (0)