Skip to content

Commit 86ae174

Browse files
authored
πŸ› fix(potential): PowerLawCutoffPotential normalization + Multipole check-init (#782)
* πŸ› fix(potential): PowerLawCutoffPotential normalization. See adrn/gala#425 * πŸ› fix(potential): Multipole check-init * ⬆️ dep-bump: gala v1.10+ * πŸ“ docs(potential): improve laplacian docs Signed-off-by: nstarman <nstarman@users.noreply.github.com>
1 parent e3e4c5e commit 86ae174

9 files changed

Lines changed: 1511 additions & 1495 deletions

File tree

β€Žpyproject.tomlβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"galax[interop-galpy]",
6868
]
6969
interop-astropy = ["astropy>=6.1"]
70-
interop-gala = ["gala>=1.9", "galax[interop-astropy]"]
70+
interop-gala = ["gala>=1.10", "galax[interop-astropy]"]
7171
interop-galpy = ["galax[interop-astropy]", "galpy >= 1.8"]
7272
# TODO: agama
7373
plot-all = ["galax[plot-matplotlib]"]
@@ -231,6 +231,7 @@ ignore-words-list = "Hart" # in dynamics/_src/cluster/relax_time.py
231231
"ignore:auto\\-close\\(\\)ing of figures upon backend switching is deprecated:DeprecationWarning",
232232
"ignore:jax\\.core\\.pp_eqn_rules is deprecated:DeprecationWarning",
233233
"ignore:numpy\\.ndarray size changed:RuntimeWarning",
234+
"ignore:The get_name method is deprecated:astropy.utils.exceptions.AstropyDeprecationWarning", # from gala
234235
"ignore:unhashable type:FutureWarning", # TODO: from diffrax
235236
"ignore:jax\\.interpreters\\.xla\\.pytype_aval_mappings is deprecated:DeprecationWarning", # from tensorflow-probability[jax]
236237
]

β€Žsrc/galax/_interop/galax_interop_gala/potential.pyβ€Ž

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def convert_potential(
6969
7070
>>> pot = gp.KeplerPotential(m_tot=1e11, units="galactic")
7171
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
72-
<KeplerPotential: m=1.00e+11 (kpc,Myr,solMass,rad)>
72+
<KeplerPotential: m=1.00e+11 solMass (kpc,Myr,solMass,rad)>
7373
7474
""" # noqa: E501
7575
return galax_to_gala(from_)
@@ -321,7 +321,7 @@ def galax_to_gala(pot: gp.BurkertPotential, /) -> galap.BurkertPotential:
321321
322322
>>> pot = gp.BurkertPotential(m=1e11, r_s=20, units="galactic")
323323
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
324-
<BurkertPotential: rho=7.82e+06, r0=20.00 (kpc,Myr,solMass,rad)>
324+
<BurkertPotential: rho=7.82e+06 solMass / kpc3, r0=20.00 kpc (kpc,Myr,solMass,rad)>
325325
326326
.. skip: end
327327
@@ -379,7 +379,7 @@ def galax_to_gala(
379379
380380
>>> pot = gp.HarmonicOscillatorPotential(omega=u.Quantity(1, "1/Myr"), units="galactic")
381381
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
382-
<HarmonicOscillatorPotential: omega=[1.] (kpc,Myr,solMass,rad)>
382+
<HarmonicOscillatorPotential: omega=[1.] 1 / Myr (kpc,Myr,solMass,rad)>
383383
384384
""" # noqa: E501
385385
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -433,7 +433,7 @@ def galax_to_gala(pot: gp.HernquistPotential, /) -> galap.HernquistPotential:
433433
434434
>>> pot = gp.HernquistPotential(m_tot=1e11, r_s=20, units="galactic")
435435
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
436-
<HernquistPotential: m=1.00e+11, c=20.00 (kpc,Myr,solMass,rad)>
436+
<HernquistPotential: m=1.00e+11 solMass, c=20.00 kpc (kpc,Myr,solMass,rad)>
437437
438438
""" # noqa: E501
439439
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -489,7 +489,7 @@ def galax_to_gala(pot: gp.IsochronePotential, /) -> galap.IsochronePotential:
489489
490490
>>> pot = gp.IsochronePotential(m_tot=1e11, r_s=10, units="galactic")
491491
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
492-
<IsochronePotential: m=1.00e+11, b=10.00 (kpc,Myr,solMass,rad)>
492+
<IsochronePotential: m=1.00e+11 solMass, b=10.00 kpc (kpc,Myr,solMass,rad)>
493493
494494
""" # noqa: E501
495495
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -549,7 +549,7 @@ def galax_to_gala(pot: gp.JaffePotential, /) -> galap.JaffePotential:
549549
550550
>>> pot = gp.JaffePotential(m_tot=1e11, r_s=20, units="galactic")
551551
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
552-
<JaffePotential: m=1.00e+11, c=20.00 (kpc,Myr,solMass,rad)>
552+
<JaffePotential: m=1.00e+11 solMass, c=20.00 kpc (kpc,Myr,solMass,rad)>
553553
554554
"""
555555
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -603,7 +603,7 @@ def galax_to_gala(pot: gp.KeplerPotential, /) -> galap.KeplerPotential:
603603
604604
>>> pot = gp.KeplerPotential(m_tot=1e11, units="galactic")
605605
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
606-
<KeplerPotential: m=1.00e+11 (kpc,Myr,solMass,rad)>
606+
<KeplerPotential: m=1.00e+11 solMass (kpc,Myr,solMass,rad)>
607607
608608
""" # noqa: E501
609609
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -663,7 +663,7 @@ def galax_to_gala(pot: gp.KuzminPotential, /) -> galap.KuzminPotential:
663663
664664
>>> pot = gp.KuzminPotential(m_tot=1e11, r_s=20, units="galactic")
665665
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
666-
<KuzminPotential: m=1.00e+11, a=20.00 (kpc,Myr,solMass,rad)>
666+
<KuzminPotential: m=1.00e+11 solMass, a=20.00 kpc (kpc,Myr,solMass,rad)>
667667
668668
""" # noqa: E501
669669
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -735,7 +735,7 @@ def galax_to_gala(pot: gp.LongMuraliBarPotential, /) -> galap.LongMuraliBarPoten
735735
... units="galactic",
736736
... )
737737
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
738-
<LongMuraliBarPotential: m=1.00e+11, a=20.00, b=10.00, c=5.00, alpha=0.10 (kpc,Myr,solMass,rad)>
738+
<LongMuraliBarPotential: m=1.00e+11 solMass, a=20.00 kpc, b=10.00 kpc, c=5.00 kpc, alpha=0.10 rad (kpc,Myr,solMass,rad)>
739739
740740
""" # noqa: E501
741741
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -795,7 +795,7 @@ def galax_to_gala(pot: gp.MiyamotoNagaiPotential, /) -> galap.MiyamotoNagaiPoten
795795
796796
>>> pot = gp.MiyamotoNagaiPotential(m_tot=1e11, a=6.5, b=0.26, units="galactic")
797797
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
798-
<MiyamotoNagaiPotential: m=1.00e+11, a=6.50, b=0.26 (kpc,Myr,solMass,rad)>
798+
<MiyamotoNagaiPotential: m=1.00e+11 solMass, a=6.50 kpc, b=0.26 kpc (kpc,Myr,solMass,rad)>
799799
800800
""" # noqa: E501
801801
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -861,7 +861,7 @@ def galax_to_gala(
861861
862862
>>> pot = gp.MN3ExponentialPotential(m_tot=1e11, h_R=3.0, h_z=0.2, units="galactic")
863863
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
864-
<MN3ExponentialDiskPotential: m=1.00e+11, h_R=3.00, h_z=0.20 (kpc,Myr,solMass,rad)>
864+
<MN3ExponentialDiskPotential: m=1.00e+11 solMass, h_R=3.00 kpc, h_z=0.20 kpc (kpc,Myr,solMass,rad)>
865865
866866
""" # noqa: E501
867867
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -969,7 +969,7 @@ def galax_to_gala(pot: gp.PlummerPotential, /) -> galap.PlummerPotential:
969969
970970
>>> pot = gp.PlummerPotential(m_tot=1e11, r_s=10, units="galactic")
971971
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
972-
<PlummerPotential: m=1.00e+11, b=10.00 (kpc,Myr,solMass,rad)>
972+
<PlummerPotential: m=1.00e+11 solMass, b=10.00 kpc (kpc,Myr,solMass,rad)>
973973
""" # noqa: E501
974974
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
975975

@@ -1044,7 +1044,7 @@ def galax_to_gala(pot: gp.PowerLawCutoffPotential, /) -> galap.PowerLawCutoffPot
10441044
10451045
>>> pot = gp.PowerLawCutoffPotential(m_tot=1e11, alpha=1.8, r_c=20, units="galactic")
10461046
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
1047-
<PowerLawCutoffPotential: m=1.00e+11, alpha=1.80, r_c=20.00 (kpc,Myr,solMass,rad)>
1047+
<PowerLawCutoffPotential: m=1.00e+11 solMass, alpha=1.80 , r_c=20.00 kpc (kpc,Myr,solMass,rad)>
10481048
10491049
.. skip: end
10501050
""" # noqa: E501
@@ -1106,7 +1106,7 @@ def galax_to_gala(pot: gp.SatohPotential, /) -> galap.SatohPotential:
11061106
11071107
>>> pot = gp.SatohPotential(m_tot=1e11, a=20, b=10, units="galactic")
11081108
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
1109-
<SatohPotential: m=1.00e+11, a=20.00, b=10.00 (kpc,Myr,solMass,rad)>
1109+
<SatohPotential: m=1.00e+11 solMass, a=20.00 kpc, b=10.00 kpc (kpc,Myr,solMass,rad)>
11101110
11111111
"""
11121112
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -1163,7 +1163,7 @@ def galax_to_gala(pot: gp.StoneOstriker15Potential, /) -> galap.StonePotential:
11631163
11641164
>>> pot = gp.StoneOstriker15Potential(m_tot=1e11, r_c=20, r_h=10, units="galactic")
11651165
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
1166-
<StonePotential: m=1.00e+11, r_c=20.00, r_h=10.00 (kpc,Myr,solMass,rad)>
1166+
<StonePotential: m=1.00e+11 solMass, r_c=20.00 kpc, r_h=10.00 kpc (kpc,Myr,solMass,rad)>
11671167
11681168
""" # noqa: E501
11691169
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -1243,7 +1243,7 @@ def galax_to_gala(pot: gp.LogarithmicPotential, /) -> galap.LogarithmicPotential
12431243
12441244
>>> pot = gp.LogarithmicPotential(v_c=u.Quantity(220, "km/s"), r_s=20, units="galactic")
12451245
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
1246-
<LogarithmicPotential: v_c=0.22, r_h=20.00, q1=1.00, q2=1.00, q3=1.00, phi=0 (kpc,Myr,solMass,rad)>
1246+
<LogarithmicPotential: v_c=0.22 kpc / Myr, r_h=20.00 kpc, q1=1.00 , q2=1.00 , q3=1.00 , phi=0 rad (kpc,Myr,solMass,rad)>
12471247
12481248
""" # noqa: E501
12491249
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -1270,7 +1270,7 @@ def galax_to_gala(pot: gp.LMJ09LogarithmicPotential, /) -> galap.LogarithmicPote
12701270
... units="galactic",
12711271
... )
12721272
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
1273-
<LogarithmicPotential: v_c=0.22, r_h=20.00, q1=1.00, q2=1.00, q3=1.00, phi=0 (kpc,Myr,solMass,rad)>
1273+
<LogarithmicPotential: v_c=0.22 kpc / Myr, r_h=20.00 kpc, q1=1.00 , q2=1.00 , q3=1.00 , phi=0 rad (kpc,Myr,solMass,rad)>
12741274
12751275
""" # noqa: E501
12761276
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -1466,7 +1466,8 @@ def galax_to_gala(pot: gp.NFWPotential, /) -> galap.NFWPotential:
14661466
14671467
>>> pot = gp.NFWPotential(m=1e12, r_s=20, units="galactic")
14681468
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
1469-
<NFWPotential: m=1.00e+12, r_s=20.00, a=1.00, b=1.00, c=1.00 (kpc,Myr,solMass,rad)>
1469+
<NFWPotential: m=1.00e+12 solMass, r_s=20.00 kpc, a=1.00 , b=1.00 , c=1.00
1470+
(kpc,Myr,solMass,rad)>
14701471
14711472
"""
14721473
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())
@@ -1534,7 +1535,7 @@ def galax_to_gala(
15341535
... a1=1, a2=0.9, a3=0.8,
15351536
... units="galactic")
15361537
>>> gp.io.convert_potential(gp.io.GalaLibrary, pot)
1537-
<LeeSutoTriaxialNFWPotential: v_c=0.47, r_s=20.00, a=1.00, b=0.90, c=0.80 (kpc,Myr,solMass,rad)>
1538+
<LeeSutoTriaxialNFWPotential: v_c=0.47 kpc / Myr, r_s=20.00 kpc, a=1.00 , b=0.90 , c=0.80 (kpc,Myr,solMass,rad)>
15381539
15391540
""" # noqa: E501
15401541
_error_if_not_all_constant_parameters(pot, *pot.parameters.keys())

β€Žsrc/galax/potential/_src/api.pyβ€Ž

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -383,48 +383,48 @@ def laplacian(*args: Any, **kwargs: Any) -> u.Quantity["1/s^2"] | Array:
383383
>>> w = gc.PhaseSpaceCoordinate(q=u.Quantity([[1, 2, 3], [4, 5, 6]], "kpc"),
384384
... p=u.Quantity([[4, 5, 6], [7, 8, 9]], "km/s"),
385385
... t=u.Quantity([0, 1], "Gyr"))
386-
>>> pot.laplacian(w)
387-
Quantity(Array([2.77555756e-17, 8.67361738e-19], dtype=float64), unit='1 / Myr2')
386+
>>> pot.laplacian(w).round(4)
387+
Quantity(Array([0., 0.], dtype=float64), unit='1 / Myr2')
388388
389389
This function is very flexible and can accept a broad variety of inputs. For
390390
example, instead of passing a
391391
`galax.coordinates.PhaseSpaceCoordinate`, we can instead pass a
392392
`~vector.FourVector`:
393393
394394
>>> w = cx.FourVector(q=u.Quantity([1, 2, 3], "kpc"), t=u.Quantity(0, "Gyr"))
395-
>>> pot.laplacian(w)
396-
Quantity(Array(2.77555756e-17, dtype=float64), unit='1 / Myr2')
395+
>>> pot.laplacian(w).round(4)
396+
Quantity(Array(0., dtype=float64), unit='1 / Myr2')
397397
398398
Or using a `~coordinax.AbstractPos3D` and time `unxt.Quantity` (which can be
399399
positional or a keyword argument):
400400
401401
>>> q = cx.CartesianPos3D.from_([1, 2, 3], "kpc")
402402
>>> t = u.Quantity(0, "Gyr")
403-
>>> pot.laplacian(q, t=t)
404-
Quantity(Array(2.77555756e-17, dtype=float64), unit='1 / Myr2')
403+
>>> pot.laplacian(q, t=t).round(4)
404+
Quantity(Array(0., dtype=float64), unit='1 / Myr2')
405405
406406
We can also compute the potential energy at multiple positions:
407407
408408
>>> q = cx.CartesianPos3D.from_([[1, 2, 3], [4, 5, 6]], "kpc")
409-
>>> pot.laplacian(q, t=t)
410-
Quantity(Array([2.77555756e-17, 8.67361738e-19], dtype=float64), unit='1 / Myr2')
409+
>>> pot.laplacian(q, t=t).round(4)
410+
Quantity(Array([0., 0.], dtype=float64), unit='1 / Myr2')
411411
412412
Instead of passing a `~coordinax.AbstractPos3D` (in this case a
413413
`~coordinax.CartesianPos3D`), we can instead pass a
414414
`unxt.Quantity`, which is interpreted as a Cartesian position:
415415
416416
>>> q = u.Quantity([1., 2, 3], "kpc")
417-
>>> pot.laplacian(q, t)
418-
Quantity(Array(2.77555756e-17, dtype=float64), unit='1 / Myr2')
417+
>>> pot.laplacian(q, t).round(4)
418+
Quantity(Array(0., dtype=float64), unit='1 / Myr2')
419419
420420
Again, this can be batched. If the input position object has no units (i.e.
421421
is an `~jax.Array`), it is assumed to be in the same unit system as the
422422
potential.
423423
424424
>>> q = jnp.asarray([[1, 2, 3], [4, 5, 6]])
425425
>>> t = 0
426-
>>> pot.laplacian(q, t)
427-
Array([2.77555756e-17, 8.67361738e-19], dtype=float64)
426+
>>> pot.laplacian(q, t).round(4)
427+
Array([0., 0.], dtype=float64)
428428
429429
- - -
430430
@@ -454,25 +454,25 @@ def laplacian(*args: Any, **kwargs: Any) -> u.Quantity["1/s^2"] | Array:
454454
We can also compute the potential energy at multiple positions:
455455
456456
>>> q = apyc.CartesianRepresentation(apyu.Quantity([[1, 4], [2, 5], [3, 6]], "kpc"))
457-
>>> pot.laplacian(q, t)
458-
Quantity(Array([2.77555756e-17, 8.67361738e-19], dtype=float64), unit='1 / Myr2')
457+
>>> pot.laplacian(q, t).round(4)
458+
Quantity(Array([0., 0.], dtype=float64), unit='1 / Myr2')
459459
460460
Instead of passing a `~coordinax.AbstractPos3D` (in this case a
461461
`~coordinax.CartesianPos3D`), we can instead pass a
462462
`unxt.Quantity`, which is interpreted as a Cartesian position:
463463
464464
>>> q = [1., 2, 3] * apyu.kpc
465-
>>> pot.laplacian(q, t)
466-
Array(2.77555756e-17, dtype=float64)
465+
>>> pot.laplacian(q, t).round(4)
466+
Array(0., dtype=float64)
467467
468468
Again, this can be batched. If the input position object has no units (i.e.
469469
is a `~numpy.ndarray`), it is assumed to be in the same unit system
470470
as the potential.
471471
472472
>>> import numpy as np
473473
>>> q = jnp.asarray([[1, 2, 3], [4, 5, 6]])
474-
>>> pot.laplacian(q, t)
475-
Array([2.77555756e-17, 8.67361738e-19], dtype=float64)
474+
>>> pot.laplacian(q, t).round(4)
475+
Array([0., 0.], dtype=float64)
476476
477477
.. skip: end
478478

β€Žsrc/galax/potential/_src/builtin/multipole.pyβ€Ž

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,11 @@ class MultipolePotential(AbstractMultipolePotential):
209209
def __check_init__(self) -> None:
210210
shape = (self.l_max + 1, self.l_max + 1)
211211
t = u.Quantity(0.0, "Gyr")
212-
is_shape, it_shape = self.ISlm(t).shape, self.ITlm(t).shape
213-
os_shape, ot_shape = self.OSlm(t).shape, self.OTlm(t).shape
214-
# TODO: check shape across time.
212+
iss, its = self.ISlm(t).shape, self.ITlm(t).shape
213+
oss, ots = self.OSlm(t).shape, self.OTlm(t).shape
214+
# Check shapes match expected
215215
msg = "I/OSlm and I/OTlm must have the shape (l_max + 1, l_max + 1)."
216-
pred = jnp.any(
217-
jnp.array([x != shape for x in (is_shape, it_shape, os_shape, ot_shape)])
218-
)
216+
pred = (iss != shape) or (its != shape) or (oss != shape) or (ots != shape)
219217
_ = eqx.error_if(t, pred, msg)
220218

221219
@ft.partial(jax.jit)

β€Žsrc/galax/potential/_src/builtin/powerlawcutoff.pyβ€Ž

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,29 @@ def _potential(self, xyz: gt.BBtQuSz3, t: gt.BBtQuSz0, /) -> gt.BtSz0:
8888
def potential(p: gt.Params, r: gt.Sz0, /) -> gt.FloatSz0:
8989
r"""Potential for the power-law cutoff density profile.
9090
91-
$$ \Phi(r) = -\frac{G M}{2\pi \Gamma\left(\frac{3 - \alpha}{2}\right) r_c^3}
92-
\left(\frac{r_c}{r}\right)^\alpha
93-
\exp\left[-\left(\frac{r}{r_c}\right)^2\right] $$
91+
Following Gala's implementation, we compute the potential and subtract
92+
the asymptotic value to enforce Phi(infinity) = 0.
9493
"""
95-
a = p["alpha"] / 2
94+
alpha_half = p["alpha"] / 2
9695
s2 = (r / p["r_c"]) ** 2
9796
GM = p["G"] * p["m_tot"]
9897

99-
return GM * (
100-
(a - 1.5) * _safe_gamma_inc(1.5 - a, s2) / (r * jsp.gamma(2.5 - a))
101-
+ _safe_gamma_inc(1 - a, s2) / (p["r_c"] * jsp.gamma(1.5 - a))
98+
# Compute potential terms
99+
gamma_arg = 1.5 - alpha_half
100+
term1 = (
101+
GM
102+
* _safe_gamma_inc(gamma_arg, s2)
103+
* (alpha_half - 1.5)
104+
/ (r * jsp.gamma(2.5 - alpha_half))
102105
)
106+
term2 = GM * _safe_gamma_inc(1 - alpha_half, s2) / (p["r_c"] * jsp.gamma(gamma_arg))
107+
108+
# Subtract asymptotic value to enforce Phi(infinity) = 0
109+
# Only needed when gamma_arg > 0 (i.e., alpha < 3)
110+
phi_infinity = jax.lax.cond(
111+
gamma_arg > 0,
112+
lambda: GM * jsp.gamma(1 - alpha_half) / (p["r_c"] * jsp.gamma(gamma_arg)),
113+
lambda: 0.0,
114+
)
115+
116+
return term1 + term2 - phi_infinity

β€Žtests/unit/potential/builtin/test_bovymwpotential2014.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def pot_map(
2929
# ==========================================================================
3030

3131
def test_potential(self, pot: gp.BovyMWPotential2014, x: gt.QuSz3) -> None:
32-
expect = u.Quantity(-0.09550731, unit="kpc2 / Myr2")
32+
expect = u.Quantity(-0.16359185, unit="kpc2 / Myr2")
3333
assert jnp.isclose(
3434
pot.potential(x, t=0), expect, atol=u.Quantity(1e-8, expect.unit)
3535
)

β€Žtests/unit/potential/builtin/test_multipole.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def test_check_init(
261261
"""Test the `MultipoleInnerPotential.__check_init__` method."""
262262
fields_["ISlm"] = fields_["ISlm"][::2] # make it the wrong shape
263263
match = re.escape("I/OSlm and I/OTlm must have the shape")
264-
with pytest.raises(eqx.EquinoxRuntimeError, match=match):
264+
with pytest.raises(eqx.EquinoxTracetimeError, match=match):
265265
pot_cls(**fields_)
266266

267267
# ==========================================================================

β€Žtests/unit/potential/builtin/test_powerlawcutoff.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def fields_(
9797
# ==========================================================================
9898

9999
def test_potential(self, pot: gp.PowerLawCutoffPotential, x: gt.QuSz3) -> None:
100-
expect = u.Quantity(6.26573365, unit="kpc2 / Myr2")
100+
expect = u.Quantity(-1.20227523, unit="kpc2 / Myr2")
101101
assert jnp.isclose(
102102
pot.potential(x, t=0), expect, atol=u.Quantity(1e-8, expect.unit)
103103
)

0 commit comments

Comments
Β (0)