firecrown.connector.cobaya.likelihood.LikelihoodConnector#
- class firecrown.connector.cobaya.likelihood.LikelihoodConnector(info=mappingproxy({}), name=None, timing=None, packages_path=None, initialize=True, standalone=True)[source]#
Bases:
Likelihood
A class implementing cobaya.likelihood.Likelihood.
- Parameters:
info (
Mapping
[str
,Any
]) –name (
Optional
[str
]) –timing (
Optional
[bool
]) –packages_path (
Optional
[str
]) –
Public Methods:
Initialize the likelihood object by loading its Firecrown configuration.
Required by Cobaya.
initialize_with_provider
(provider)Required by Cobaya.
Required by Cobaya.
Required by Cobaya.
Required by Cobaya.
must_provide
(**requirements)Required by Cobaya.
logp
(**params_values)Required by Cobaya.
Inherited from
Likelihood
__init__
([info, name, timing, ...])- param info:
logp
(**params_values)Computes and returns the log likelihood value.
marginal
([directions, params_values])(For analytic likelihoods only.) Computes the marginal likelihood.
calculate
(state[, want_derived])Calculates the likelihood and any derived parameters or needs.
wait
()Inherited from
Theory
__init__
([info, name, timing, ...])- param info:
get_requirements
()Get a dictionary of requirements (or a list of requirement name, option tuples) that are always needed (e.g.
must_provide
(**requirements)Function called by Cobaya with the actual products that this component needs to compute (i.e.
calculate
(state[, want_derived])Do the actual calculation and store results in state dict
initialize_with_params
()Additional initialization after requirements called and input_params and output_params have been assigned (but provider and assigned requirements not yet set).
initialize_with_provider
(provider)Final initialization after parameters, provider and assigned requirements set.
get_param
(p)Interface function for likelihoods and other theory components to get derived parameters.
get_result
(result_name, **kwargs)Interface function for likelihood and other theory components to get quantities calculated by this component.
get_can_provide_methods
()Get a dictionary of quantities X that can be retrieved using get_X methods.
get_can_provide
()Get a list of names of quantities that can be retrieved using the general get_result(X) method.
get_can_provide_params
()Get a list of derived parameters that this component can calculate.
get_can_support_params
()Get a list of parameters supported by this component, can be used to support parameters that don't explicitly appear in the .yaml or class params attribute or are otherwise explicitly supported (e.g.
get_allow_agnostic
()Whether it is allowed to pass all unassigned input parameters to this component (True) or whether parameters must be explicitly specified (False).
set_cache_size
(n)Set how many states to cache
check_cache_and_compute
(params_values_dict)Takes a dictionary of parameter values and computes the products needed by the likelihood, or uses the cached value if that exists for these parameters.
get_provider
()Return object containing get_X, get_param, get_result methods to get computed results.
get_helper_theories
()Return dictionary of optional names and helper Theory instances that should be used in conjunction with this component.
update_for_helper_theories
(helpers)- param helpers:
get_attr_list_with_helpers
(attr)Get combined list of self.attr and helper.attr for all helper theories
get_speed
()set_measured_speed
(speed)Inherited from
CobayaComponent
__init__
([info, name, timing, ...])- param info:
set_timing_on
(on)get_name
()Get the name.
__repr__
()Return repr(self).
close
(*args)Finalizes the class, if something needs to be cleaned up.
set_instance_defaults
()Can use this to define any default instance attributes before setting to the input dictionary (from inputs or defaults)
initialize
()Initializes the class (called from __init__, before other initializations).
get_version
()Get version information for this component.
has_version
()Whether to track version information for this component
validate_info
(k, value, annotations)Does any validation on parameter k read from an input dictionary or yaml file, before setting the corresponding class attribute.
get_kind
()Return, as a string, the kind of this component.
compare_versions
(version_a, version_b[, equal])Checks whether
version_a
is equal or higher thanversion_b
.__exit__
(exception_type, exception_value, ...)Inherited from
HasLogger
set_logger
([lowercase, name])__getstate__
()Returns the current state, removing the logger (not picklable).
__setstate__
(d)is_debug
()is_debug_and_mpi_root
()mpi_warning
(msg, *args, **kwargs)mpi_info
(msg, *args, **kwargs)mpi_debug
(msg, *args, **kwargs)Inherited from
HasDefaults
get_qualified_names
()- rtype:
List
[str
]
get_qualified_class_name
()Get the distinct shortest reference name for the class of the form module.ClassName or module.submodule.ClassName etc.
get_class_path
()Get the file path for the class.
get_file_base_name
()Gets the string used as the name for .yaml, .bib files, typically the class name or an un-CamelCased class name
get_root_file_name
()- rtype:
str
get_yaml_file
()Gets the file name of the .yaml file for this component if it exists on file (otherwise None).
get_desc
()Returns a short description of the class.
get_bibtex
()Get the content of .bibtex file for this component.
get_associated_file_content
(ext[, file_root])Return the content of the associated file, if it exists.
get_text_file_content
(file_name)Return the content of a file in the directory of the module, if it exists.
get_class_options
([input_options])Returns dictionary of names and values for class variables that can also be input and output in yaml files, by default it takes all the (non-inherited and non-private) attributes of the class excluding known specials.
get_defaults
([return_yaml, ...])Return defaults for this component_or_class, with syntax:
get_annotations
()- rtype:
Dict
[str
,Any
]
Private Methods:
Inherited from
HasDefaults
_get_desc
([info])
- get_requirements()[source]#
Required by Cobaya.
Returns a dictionary with keys corresponding the contained likelihood’s required parameter, plus “pyccl”. All values are None.
- Return type:
dict
[str
,None
|dict
[str
,ndarray
[Any
,dtype
[float64
]]] |dict
[str
,object
]]
- initialize_with_params()[source]#
Required by Cobaya.
This version has nothing to do.
- Return type:
None
- initialize_with_provider(provider)[source]#
Required by Cobaya.
Sets instance’s provided to the given provider.
- Return type:
None