Skip to content

Commit caecf66

Browse files
committed
fix: start to remove has_tracers func
1 parent f7aa2a6 commit caecf66

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

jax_galsim/bounds.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
cast_to_int,
1010
check_is_int_then_cast,
1111
ensure_hashable,
12-
has_tracers,
1312
implements,
1413
)
1514
from jax_galsim.position import Position, PositionD, PositionI
@@ -515,7 +514,10 @@ def __init__(self, *args, **kwargs):
515514
self.deltax = cast_to_int(self.deltax)
516515
self.deltay = cast_to_int(self.deltay)
517516

518-
if has_tracers(self._xmin) or has_tracers(self._ymin):
517+
if not (
518+
isinstance(self._xmin, (int, float, np.floating, np.integer))
519+
and isinstance(self._ymin, (int, float, np.floating, np.integer))
520+
):
519521
self._isstatic = False
520522

521523
# validate inputs are ints

jax_galsim/moffat.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from jax_galsim.core.math import safe_sqrt
1414
from jax_galsim.core.utils import (
1515
ensure_hashable,
16-
has_tracers,
1716
implements,
1817
)
1918
from jax_galsim.gsobject import GSObject
@@ -59,13 +58,10 @@ def __init__(
5958
# let define beta_thr a threshold to trigger the truncature
6059
self._beta_thr = 1.1
6160

62-
if has_tracers(trunc) or (
63-
isinstance(trunc, (np.ndarray, float, jnp.ndarray, int))
64-
and np.any(trunc != 0)
65-
):
61+
if (not isinstance(trunc, (float, int))) or trunc != 0:
6662
raise ValueError(
6763
"JAX-GalSim does not support truncated Moffat profiles "
68-
f"(got trunc={repr(trunc)}, always pass the constant 0.0)!"
64+
f"(got trunc={trunc!r}, always pass the constant 0.0)!"
6965
)
7066

7167
if isinstance(beta, (float, int)):

0 commit comments

Comments
 (0)