diff --git a/autogalaxy/cosmology/model.py b/autogalaxy/cosmology/model.py index 2b0b418c..f28cf20a 100644 --- a/autogalaxy/cosmology/model.py +++ b/autogalaxy/cosmology/model.py @@ -123,7 +123,7 @@ def angular_diameter_distance_to_earth_in_kpc_from( Weinberg, 1972, pp 421-424; Weedman, 1986, pp 65-67; Peebles, 1993, pp 325-327. For simplicity, **PyAutoLens** internally uses only certain units to perform lensing cosmology calculations. - This function therefore returns only the value of the astropy function it wraps, omitting the units instance. + This function therefore returns a plain value in kpc, with no units instance attached. Parameters ---------- @@ -139,7 +139,7 @@ def angular_diameter_distance_between_redshifts_in_kpc_from( Angular diameter distance from an input `redshift_0` to another input `redshift_1`. For simplicity, **PyAutoLens** internally uses only certain units to perform lensing cosmology calculations. - This function therefore returns only the value of the astropy function it wraps, omitting the units instance. + This function therefore returns a plain value in kpc, with no units instance attached. Parameters ---------- @@ -212,13 +212,9 @@ def critical_density(self, z: float, xp=np): """ Critical density of the Universe at redshift z, returned in Msun / kpc^3. - This is an xp (NumPy / JAX) drop-in for the Astropy method: - astropy.cosmology.FLRW.critical_density(z) - - Astropy returns g/cm^3, but in AutoLens you were immediately converting to: - solMass / kpc^3 - - So this function returns Msun / kpc^3 directly. + A native xp (NumPy / JAX) implementation whose value matches the astropy method + astropy.cosmology.FLRW.critical_density(z) after converting its g / cm^3 result + to Msun / kpc^3 — the units lensing calculations use directly. Requires: self.H0 (km/s/Mpc) diff --git a/pyproject.toml b/pyproject.toml index 5a833bd4..40e0bcb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ # PyAutoLens#687. "autofit>=2026.7.29.2", "autoarray>=2026.7.29.2", - "astropy>=5.0,<=7.2.0", + "astropy>=5.0", "nautilus-sampler==1.0.5" ]