wcosmo.utils#

Helper functions that are not directly relevant to cosmology.

array_namespace(obj)

Get the array namespace from an array object

autodoc(func)

Simple decorator to mark that a docstring needs formatting

convert_quantity_if_necessary(arg[, unit, xp])

Helper function to convert between astropy and unxt quantities and non-unitful values.

default_array_namespace()

disable_units()

Disable the use of astropy units throughout the package

enable_units()

Enable the use of astropy units throughout the package

method_autodoc([alt])

Simple decorator to mark that a docstring needs formatting.

maybe_jit(func, *jit_args, **jit_kwargs)

A decorator to jit the function if using jax.

strip_units(value)

Strip units from a value if they are present also make sure that the result is not a numpy.float64.