GenMFGrowth

class hmf.core.growth_models.GenMFGrowth(*, a_min=1e-08, dln_a=0.01)[source]

The growth factor of the genmf code (Reed et al. 2007).

Exact for a flat universe with a cosmological constant, or an open universe without one, and no radiation. For other LambdaCDM cosmologies with Lambda and non-negative curvature it uses the flat formula, as an approximation. The growth rate is the derivative of the spline of ln D.

Parameters:
  • a_min (float, default 1e-08) – The smallest scale factor of the grid; z_max = 1/a_min - 1.

  • dln_a (float, default 0.01) – The spacing of the grid in ln a.

Attributes

a_min: float
alias: ClassVar[str | None] = 'GenMF'

The short name the model is registered under, if any. Set by the alias class keyword; never inherited.

backend: ClassVar[str | None] = None

The Boltzmann code that computes the model ("camb" or "class"), if any.

calibration_domain: ClassVar[Domain | None] = None

Where the model was calibrated, if that is stated by its source.

dln_a: float
parameter_source: ClassVar[str] = ''

The exact source (paper, version, table or equation) of the parameter defaults, e.g. “Tinker et al. 2008, ApJ 688, 709 (published), Table 2”.

references: ClassVar[tuple[str, ...]] = ('Reed, D. S., et al., 2007. MNRAS 374, 2. https://doi.org/10.1111/j.1365-2966.2006.11204.x',)

References to cite when the model is used, each a formatted citation.

valid_domain: ClassVar[Domain] = Domain(bounds=(('z', Interval(lower=0.0, upper=inf, unit=None, lower_open=False, upper_open=True)),), source='z >= 0.')

z >= 0. The Growth stage checks z against the model’s class’s domain (so a model can narrow it), and also against the redshifts its solution covers (up to GrowthSolution.z_max, e.g. a table’s largest redshift): growth is never extrapolated.

Type:

Where the model can be evaluated

Methods

check_cosmology(cosmology: FLRW) → None[source]

Raise unless the cosmology is a flat or open LambdaCDM.

classmethod coerce(value: object) → Self

Convert a value to a model of this kind: the converter of a model field.

Parameters:

value – An instance of cls, which is returned as it is; or a name, import path or class that get() accepts, which is looked up and instantiated with its default parameters.

Returns:

An instance of cls.

Return type:

Model

Raises:
  • ModelNotFoundError – If value is a name that no model of this kind is known by.

  • TypeError – If value is of any other type, or names a class that is not a concrete subclass of cls.

Examples

>>> from hmf.core.filters import Filter, TopHat
>>> Filter.coerce("TopHat") == TopHat()
True
classmethod fields_info() → tuple[FieldInfo, ...]

Describe this class’s fields, without creating an instance.

Returns:

The name, type, default and documentation of each field.

Return type:

tuple of FieldInfo

classmethod get(name: str | type[Model]) → type[Self]

Look up a model of this kind.

Parameters:

name – An alias ("Tinker08"), a qualified name ("hmf.core.fits:Tinker08"), an import path to a class not yet imported ("pkg.mod:Cls" or "pkg.mod.Cls"), or a class.

Returns:

The model class (not an instance). It is always a subclass of cls.

Return type:

type

Raises:
  • ModelNotFoundError – If no model of this kind is known by name, even after loading the hmf.models entry points and trying name as an import path.

  • TypeError – If name resolves to something that is not a concrete subclass of cls.

classmethod get_aliases() → Mapping[str, str]

Return a read-only mapping from alias to qualified name, for this kind.

classmethod get_models() → Mapping[str, type[Self]]

Return the registered models of this kind, by qualified name.

Plugins advertised in the hmf.models entry-point group are loaded first.

Returns:

A read-only mapping from qualified name to class. Called on a kind, it is a live view of the registry. Called on a non-kind subclass, it holds only the models that subclass it.

Return type:

Mapping

classmethod qualified_name() → str

Return this class’s qualified name, package.module:Class.

solve(cosmology: FLRW, *, run: BoltzmannRun | None = None, disk_cache: DiskCache | None = None, k_accuracy: KAccuracy = KAccuracy(dln_k=0.02, ln_k_min=-18.420680743952367, k_max_r_min=20.0)) → GrowthSolution

Compute the growth (see GrowthModel.solve()).