gwkokab.analysis.core.analysis_base¶

Classes¶

AnalysisBase

AnalysisBase is a class which contains all the common functionality among the

Functions¶

analysis_base_arg_parser(→ argparse.ArgumentParser)

Populate the command line argument parser with the arguments for the AnalysisBase

Module Contents¶

class gwkokab.analysis.core.analysis_base.AnalysisBase(*, analysis_name: str, check_leaks: bool, debug_nans: bool, model: numpyro.distributions.distribution.Distribution | collections.abc.Callable[Ellipsis, numpyro.distributions.distribution.Distribution], poisson_mean_filename: str, prior_filename: str, profile_memory: bool, sampler_cfg, variance_cut_threshold: float | None)¶

Bases: gwkokab.analysis.core.utils.PRNGKeyMixin

AnalysisBase is a class which contains all the common functionality among the different analyses.

It is not meant to be used directly, but rather to be subclassed by the specific analyses.

classify_model_parameters() Tuple[Dict[str, int | float | bool | None], gwkokab.models.utils.JointDistribution, Dict[str, int], Dict[str, int]]¶

Classify model parameters into constants, priors, and variables index.

Returns:

A tuple containing the constants, the distribution function, the prior distribution, and the variables index.

Return type:

Tuple[ Dict[str, Union[int, float, bool, None]], Callable[…, Distribution], JointDistribution, Dict[str, int], ]

abstractmethod driver(*, logpdf: collections.abc.Callable[[jaxtyping.Array, Dict[str, Any]], jaxtyping.Array], priors: gwkokab.models.utils.JointDistribution, data: Any, labels: List[str]) None¶
modify_model_params(params: dict) dict¶

Hook for subclasses to modify parameters before model instantiation.

analysis_name¶
check_leaks¶
debug_nans¶
model¶
property model_parameters: List[str]¶
Abstractmethod:

Returns the model parameters.

Returns:

List of model parameters.

Return type:

List[str]

Raises:

NotImplementedError – If the AnalysisBase class is used directly, this method raises a NotImplementedError. It is expected that subclasses of AnalysisBase will implement this method.

property parameters: List[str] | Tuple[str, Ellipsis]¶
Abstractmethod:

Returns the parameters (intrinsic + extrinsic).

Returns:

List or tuple of parameter names.

Return type:

Union[List[str], Tuple[str, …]]

Raises:

NotImplementedError – If the AnalysisBase class is used directly, this method raises a NotImplementedError. It is expected that subclasses of AnalysisBase will implement this method.

poisson_mean_filename¶
prior_filename¶
profile_memory¶
sampler_cfg¶
variance_cut_threshold¶
gwkokab.analysis.core.analysis_base.analysis_base_arg_parser(parser: argparse.ArgumentParser) argparse.ArgumentParser¶

Populate the command line argument parser with the arguments for the AnalysisBase script.

Parameters:

parser (ArgumentParser) – Parser to add the arguments to

Returns:

the command line argument parser

Return type:

ArgumentParser