firecrown.ccl_factory ===================== .. py:module:: firecrown.ccl_factory .. autoapi-nested-parse:: This module contains the CCLFactory class and it supporting classes. The CCLFactory class is a factory class that creates instances of the `pyccl.Cosmology` class. Attributes ---------- .. autoapisummary:: firecrown.ccl_factory.PowerSpec firecrown.ccl_factory.Background firecrown.ccl_factory.CCLCalculatorArgs Classes ------- .. autoapisummary:: firecrown.ccl_factory.PoweSpecAmplitudeParameter firecrown.ccl_factory.CCLCreationMode firecrown.ccl_factory.MuSigmaModel firecrown.ccl_factory.CAMBExtraParams firecrown.ccl_factory.CCLSplineParams firecrown.ccl_factory.CCLFactory Module Contents --------------- .. py:data:: PowerSpec .. py:data:: Background .. py:data:: CCLCalculatorArgs .. py:class:: PoweSpecAmplitudeParameter Bases: :py:obj:`firecrown.utils.YAMLSerializable`, :py:obj:`enum.StrEnum` .. autoapi-inheritance-diagram:: firecrown.ccl_factory.PoweSpecAmplitudeParameter :parts: 1 This class defines the two-point correlation space. The two-point correlation space can be either real or harmonic. The real space corresponds measurements in terms of angular separation, while the harmonic space corresponds to measurements in terms of spherical harmonics decomposition. .. py:attribute:: AS .. py:attribute:: SIGMA8 .. py:method:: __get_pydantic_core_schema__(_source_type, _handler) :classmethod: Get the Pydantic core schema for the PoweSpecAmplitudeParameter class. .. py:class:: CCLCreationMode Bases: :py:obj:`enum.StrEnum` .. autoapi-inheritance-diagram:: firecrown.ccl_factory.CCLCreationMode :parts: 1 This class defines the CCL instance creation mode. The DEFAULT mode represents the current CCL behavior. It will use CCL's calculator mode if `prepare` is called with a `CCLCalculatorArgs` object. Otherwise, it will use the default CCL mode. The MU_SIGMA_ISITGR mode enables the mu-sigma modified gravity model with the ISiTGR transfer function, it is not compatible with the Calculator mode. The PURE_CCL_MODE mode will create a CCL instance with the default parameters. It is not compatible with the Calculator mode. .. py:attribute:: DEFAULT .. py:attribute:: MU_SIGMA_ISITGR .. py:attribute:: PURE_CCL_MODE .. py:method:: __get_pydantic_core_schema__(_source_type, _handler) :classmethod: Get the Pydantic core schema for the CCLCreationMode class. .. py:class:: MuSigmaModel Bases: :py:obj:`firecrown.updatable.Updatable` .. autoapi-inheritance-diagram:: firecrown.ccl_factory.MuSigmaModel :parts: 1 Model for the mu-sigma modified gravity model. .. py:attribute:: mu .. py:attribute:: sigma .. py:attribute:: c1 .. py:attribute:: c2 .. py:attribute:: lambda0 .. py:method:: create() Create a `pyccl.modified_gravity.MuSigmaMG` object. .. py:class:: CAMBExtraParams(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.ccl_factory.CAMBExtraParams :parts: 1 Extra parameters for CAMB. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: HMCode_A_baryon :type: Annotated[float | None, Field(frozen=False)] :value: None .. py:attribute:: HMCode_eta_baryon :type: Annotated[float | None, Field(frozen=False)] :value: None .. py:attribute:: HMCode_logT_AGN :type: Annotated[float | None, Field(frozen=False)] :value: None .. py:attribute:: halofit_version :type: Annotated[str | None, Field(frozen=True)] :value: None .. py:attribute:: kmax :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: lmax :type: Annotated[int | None, Field(frozen=True)] :value: None .. py:attribute:: dark_energy_model :type: Annotated[str | None, Field(frozen=True)] :value: None .. py:method:: get_dict() Return the extra parameters as a dictionary. .. py:method:: update(params) Update the CAMB sampling parameters. :param params: The parameters to update. :return: None .. py:class:: CCLSplineParams(/, **data) Bases: :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.ccl_factory.CCLSplineParams :parts: 1 Params to control CCL spline interpolation. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: a_spline_na :type: Annotated[int | None, Field(frozen=True)] :value: None .. py:attribute:: a_spline_min :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: a_spline_minlog_pk :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: a_spline_min_pk :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: a_spline_minlog_sm :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: a_spline_min_sm :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: a_spline_minlog :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: a_spline_nlog :type: Annotated[int | None, Field(frozen=True)] :value: None .. py:attribute:: logm_spline_delta :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: logm_spline_nm :type: Annotated[int | None, Field(frozen=True)] :value: None .. py:attribute:: logm_spline_min :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: logm_spline_max :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: a_spline_na_sm :type: Annotated[int | None, Field(frozen=True)] :value: None .. py:attribute:: a_spline_nlog_sm :type: Annotated[int | None, Field(frozen=True)] :value: None .. py:attribute:: a_spline_na_pk :type: Annotated[int | None, Field(frozen=True)] :value: None .. py:attribute:: a_spline_nlog_pk :type: Annotated[int | None, Field(frozen=True)] :value: None .. py:attribute:: k_max_spline :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: k_max :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: k_min :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: dlogk_integration :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: dchi_integration :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: n_k :type: Annotated[int | None, Field(frozen=True)] :value: None .. py:attribute:: n_k_3dcor :type: Annotated[int | None, Field(frozen=True)] :value: None .. py:attribute:: ell_min_corr :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: ell_max_corr :type: Annotated[float | None, Field(frozen=True)] :value: None .. py:attribute:: n_ell_corr :type: Annotated[int | None, Field(frozen=True)] :value: None .. py:method:: check_spline_params() Check that the spline parameters are valid. .. py:method:: __enter__() Enter the context manager. This method saves the current CCL global spline parameters, updates them with the values from this `CCLSplineParams` instance, and returns the instance itself. This allows for temporary modification of CCL spline parameters using a `with` statement. :return: The current instance with updated spline parameters. .. py:method:: __exit__(exc_type, exc_value, traceback) Exit the context manager. This method resets the CCL global spline parameters to their original values, as saved when entering the context manager. It ensures that any temporary modifications made to the CCL spline parameters within a `with` statement are reverted upon exit. :param exc_type: The exception type, if an exception occurred. :param exc_value: The exception value, if an exception occurred. :param traceback: The traceback object, if an exception occurred. .. py:class:: CCLFactory(**data) Bases: :py:obj:`firecrown.updatable.Updatable`, :py:obj:`pydantic.BaseModel` .. autoapi-inheritance-diagram:: firecrown.ccl_factory.CCLFactory :parts: 1 Factory class for creating instances of the `pyccl.Cosmology` class. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: require_nonlinear_pk :type: Annotated[bool, Field(frozen=True)] :value: False .. py:attribute:: amplitude_parameter :type: Annotated[PoweSpecAmplitudeParameter, Field(frozen=True)] .. py:attribute:: mass_split :type: Annotated[pyccl.neutrinos.NeutrinoMassSplits, BeforeValidator(_validate_neutrino_mass_splits), Field(frozen=True)] .. py:attribute:: creation_mode :type: Annotated[CCLCreationMode, Field(frozen=True)] .. py:attribute:: use_camb_hm_sampling :type: Annotated[bool, Field(frozen=True)] :value: False .. py:attribute:: camb_extra_params :type: Annotated[CAMBExtraParams | None, Field(frozen=True)] :value: None .. py:attribute:: ccl_spline_params :type: Annotated[CCLSplineParams | None, Field(frozen=True)] :value: None .. py:attribute:: Omega_c .. py:attribute:: Omega_b .. py:attribute:: h .. py:attribute:: n_s .. py:attribute:: Omega_k .. py:attribute:: Neff .. py:attribute:: m_nu .. py:attribute:: w0 .. py:attribute:: wa .. py:attribute:: T_CMB .. py:method:: serialize_model(nxt, _) Serialize the CCLFactory object. .. py:method:: serialize_mass_split(value) :classmethod: Serialize the mass split parameter. .. py:method:: model_post_init(_, /) Initialize the WeakLensingFactory object. .. py:method:: create(calculator_args = None) Create a `pyccl.Cosmology` object. .. py:method:: get() Return the `pyccl.Cosmology` object.