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 unlessastropy.cosmology.unitsis enabled. This context manager enables it (withastropy.units.add_enabled_units()) for the duration of the block only. It does not enable thewith_H0()equivalency.Examples
>>> with littleh_units_enabled(): ... unit = u.Unit("Msun / littleh") >>> unit == Msun_h True