hmf.core.units.littleh_units_enabled

hmf.core.units.littleh_units_enabled() → Iterator[None][source]

Enable parsing of unit strings that contain littleh.

u.Unit("Msun/littleh") raises unless astropy.cosmology.units is enabled. This context manager enables it (with astropy.units.add_enabled_units()) for the duration of the block only. It does not enable the with_H0() equivalency.

Examples

>>> with littleh_units_enabled():
...     unit = u.Unit("Msun / littleh")
>>> unit == Msun_h
True