Skip to content

Commit

Permalink
return 3 MN's explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
adrn committed Sep 2, 2024
1 parent bf4fb78 commit c9bb2d0
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/galax/potential/_potential/builtin/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,15 +464,19 @@ def _get_mn_components(
param_vec = K @ x

# use fitting function to get the Miyamoto-Nagai component parameters
# NOTE(adrn): I had to add .value here otherwise when @jit'ing, this function
# would hang indefinitely...not sure why
mn_ms = param_vec[:3] * self.m_tot(t).value
mn_as = param_vec[3:] * hR.value
mn_b = b_hR * hR.value

mn_ms = param_vec[:3] * self.m_tot(t)
mn_as = param_vec[3:] * hR
mn_b = b_hR * hR
return [
MiyamotoNagaiPotential(m_tot=m, a=a, b=mn_b, units=self.units)
for m, a in zip(mn_ms, mn_as, strict=True)
MiyamotoNagaiPotential(
m_tot=mn_ms[0], a=mn_as[0], b=mn_b, units=self.units
),
MiyamotoNagaiPotential(
m_tot=mn_ms[1], a=mn_as[1], b=mn_b, units=self.units
),
MiyamotoNagaiPotential(
m_tot=mn_ms[2], a=mn_as[2], b=mn_b, units=self.units
),
]

@partial(jax.jit)
Expand Down

0 comments on commit c9bb2d0

Please sign in to comment.