Skip to content

v0.1.0

Latest

Choose a tag to compare

@nstarman nstarman released this 09 Oct 18:09
· 3 commits to versions/v0.1.x since this release
b270ed1

galax v0.1.0

galax now runs on coordinax 0.24 and unxt 2.0. This is the headline of the
release, and it is a breaking one for code that annotates parameter functions
(see "Migrating" below).

Highlights

Support for coordinax 0.24 and unxt 2

  • Requires coordinax>=0.24.1,<0.25 (was >=0.23.3,<0.24) and
    unxt>=2.0.5,<3 (was >=1.11.2,<2).
  • unxt 2 moved parametric quantities and gala interop out of unxt itself, so
    galax now also depends on unxts.parametric>=2.0,<3, and the interop-gala
    extra pulls in unxts.interop.gala>=2.0,<3.
  • The [tool.unxt] configuration table is now [tool.unxts.unxt].
  • galax's own code, tests and doctests were updated to unxt 2's comparison repr
    and error types, and to coordinax 0.24's APIs. The full suite passes against
    coordinax 0.24.1 and unxt 2.0.5.

coordinax 0.24.0 itself is not supported: the floor is 0.24.1, which is
the first 0.24 release that works with unxt 2.

Fewer dependencies

  • tfp-nightly is no longer a dependency. Its only use, in gNFWPotential, is
    replaced by a native hyp2f1 (see below).

Migrating

Breaking: a parameter function's return annotation must now record its
dimension with unxts.parametric.ParametricQuantity[...]. A bare
unxt.Quantity[...] raises TypeError.

# before
def f(t: Quantity["time"]) -> Quantity["mass density"]: ...

# after
from unxts.parametric import ParametricQuantity as PQ

def f(t: PQ["time"]) -> PQ["mass density"]: ...

Install or upgrade the matching stack together:

pip install -U "galax" "coordinax>=0.24.1" "unxt>=2.0.5"
pip install -U "galax[interop-gala]"   # if you use gala interop

Bug fixes

Potentials

  • gNFWPotential (#818, fixes #817, #819, #820): no longer returns NaN for
    r >= 9 r_s; gradients with respect to gamma are no longer silently wrong;
    .hessian() and .tidal_tensor() no longer raise. All three traced to
    tensorflow_probability's hyp2f1, now replaced with a native one.
  • Multipole potentials (MultipoleInnerPotential,
    MultipoleOuterPotential, MultipolePotential):
    • batched evaluation of compute_Ylm reused the first l/m for every
      element (#834);
    • gradients and hessians of every m >= 1 term were NaN on the entire
      z-axis, because spherical harmonics are now evaluated in Cartesian form
      (#836);
    • the hessian is now finite at the origin;
    • the density is now exactly zero away from the origin, instead of ~1e-5
      Msun/kpc^3 of autodiff cancellation noise.
  • Time-dependent translation parameters: TimeDependentTranslationParameter.from_
    kept values in kpc and Myr beside a dimensionless unit system when units
    was omitted. It now keeps the derived unit system (#922).

Dynamics

  • parse_time_spec added t0 once per step instead of once, so a nonzero
    t0 gave wrong times (t0=10, dt=[1,2,3] gave [10, 11, 23, 36]; now
    [10, 11, 13, 16]). It is public and raised no error (#935).
  • MockStream.__init__ discarded its frame-normalized arms and passed the
    untransformed inputs on (#935).
  • Runtime typechecking was silently off for orbit, mockstream and
    cluster, because their import hooks named the wrong modules (#935).
  • MockStreamArm indexing by array-like returned a fixed [True] mask
    regardless of the index or the length of t (#914, fixes #913).

Interop

  • gala 1.11: MilkyWayPotential conversion works again; galax pins
    version="v1" so the converted model stays fixed (#833).

Docs and tests

  • Docs now build with uv (#926); each doctest is collected once (#867).
  • test_second_deriv tolerance loosened, cutting its runtime from ~700s to
    ~25s (#876).

Compatibility

package v0.0.3 v0.1.0
coordinax >=0.23.3,<0.24 >=0.24.1,<0.25
unxt >=1.11.2,<2 >=2.0.5,<3
unxts.parametric -- >=2.0,<3
unxts.interop.gala (interop-gala extra) -- >=2.0,<3
tfp-nightly required removed