gwkokab.analysis.core.analysis_base =================================== .. py:module:: gwkokab.analysis.core.analysis_base Classes ------- .. autoapisummary:: gwkokab.analysis.core.analysis_base.AnalysisBase Functions --------- .. autoapisummary:: gwkokab.analysis.core.analysis_base.analysis_base_arg_parser Module Contents --------------- .. py:class:: AnalysisBase(*, analysis_name: str, check_leaks: bool, debug_nans: bool, model: Union[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: :py:obj:`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. .. py:method:: classify_model_parameters() -> Tuple[Dict[str, Union[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. :rtype: Tuple[ Dict[str, Union[int, float, bool, None]], Callable[..., Distribution], JointDistribution, Dict[str, int], ] .. py:method:: driver(*, logpdf: collections.abc.Callable[[jaxtyping.Array, Dict[str, Any]], jaxtyping.Array], priors: gwkokab.models.utils.JointDistribution, data: Any, labels: List[str]) -> None :abstractmethod: .. py:method:: modify_model_params(params: dict) -> dict Hook for subclasses to modify parameters before model instantiation. .. py:attribute:: analysis_name .. py:attribute:: check_leaks .. py:attribute:: debug_nans .. py:attribute:: model .. py:property:: model_parameters :type: List[str] :abstractmethod: Returns the model parameters. :returns: List of model parameters. :rtype: 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. .. py:property:: parameters :type: Union[List[str], Tuple[str, Ellipsis]] :abstractmethod: Returns the parameters (intrinsic + extrinsic). :returns: List or tuple of parameter names. :rtype: 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. .. py:attribute:: poisson_mean_filename .. py:attribute:: prior_filename .. py:attribute:: profile_memory .. py:attribute:: sampler_cfg .. py:attribute:: variance_cut_threshold .. py:function:: analysis_base_arg_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParser Populate the command line argument parser with the arguments for the AnalysisBase script. :param parser: Parser to add the arguments to :type parser: ArgumentParser :returns: the command line argument parser :rtype: ArgumentParser