Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions autogalaxy/cosmology/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -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
----------
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

Expand Down