From 63878677c32b9f86ab0193fe9782774a6e1d8860 Mon Sep 17 00:00:00 2001 From: Colm Talbot <colm.talbot@ligo.org> Date: Tue, 15 Feb 2022 16:08:53 +0000 Subject: [PATCH] fix docstring lengths --- bilby/core/grid.py | 2 +- bilby/core/prior/analytical.py | 4 ++-- bilby/core/prior/dict.py | 4 ++-- bilby/core/result.py | 6 +++--- bilby/gw/conversion.py | 2 +- bilby/gw/detector/networks.py | 2 +- bilby/gw/detector/strain_data.py | 2 +- bilby/gw/prior.py | 2 +- bilby/gw/utils.py | 2 +- bilby/gw/waveform_generator.py | 4 ++-- docs/bilby-mcmc-guide.txt | 10 +++------- 11 files changed, 18 insertions(+), 22 deletions(-) diff --git a/bilby/core/grid.py b/bilby/core/grid.py index 4efc8997b..4e88168a4 100644 --- a/bilby/core/grid.py +++ b/bilby/core/grid.py @@ -436,7 +436,7 @@ class Grid(object): grid: bilby.core.grid.Grid Raises - ======= + ====== ValueError: If no filename is given and either outdir or label is None If no bilby.core.grid.Grid is found in the path diff --git a/bilby/core/prior/analytical.py b/bilby/core/prior/analytical.py index c5356c650..9443fc4c5 100644 --- a/bilby/core/prior/analytical.py +++ b/bilby/core/prior/analytical.py @@ -1430,8 +1430,8 @@ class Categorical(Prior): unit=None, boundary="periodic"): """ An equal-weighted Categorical prior - Parameters: - ----------- + Parameters + ========== ncategories: int The number of available categories. The prior mass support is then integers [0, ncategories - 1]. diff --git a/bilby/core/prior/dict.py b/bilby/core/prior/dict.py index 15e6199da..25b9d204e 100644 --- a/bilby/core/prior/dict.py +++ b/bilby/core/prior/dict.py @@ -686,7 +686,7 @@ class ConditionalPriorDict(PriorDict): Name of the key that we want to know the required variables for Returns - ========== + ======= dict: key/value pairs of the required variables """ return {k: self[k].least_recently_sampled for k in getattr(self[key], 'required_variables', [])} @@ -857,7 +857,7 @@ def create_default_prior(name, default_priors_file=None): If given, a file containing the default priors. Returns - ====== + ======= prior: Prior Default prior distribution for that parameter, if unknown None is returned. diff --git a/bilby/core/result.py b/bilby/core/result.py index 27c88c5cb..c8d9a517c 100644 --- a/bilby/core/result.py +++ b/bilby/core/result.py @@ -381,7 +381,7 @@ class Result(object): this information is generated when the result object is initialized Notes - ========= + ===== All sampling output parameters, e.g. the samples themselves are typically not given at initialisation, but set at a later stage. @@ -436,7 +436,7 @@ class Result(object): result: bilby.core.result.Result Raises - ======= + ====== ValueError: If no filename is given and either outdir or label is None If no bilby.core.result.Result is found in the path @@ -1097,7 +1097,7 @@ class Result(object): to override the outdir set by the absolute path of the result object. Notes - ----- + ===== The generation of the corner plot themselves is done by the corner python module, see https://corner.readthedocs.io for more information. diff --git a/bilby/gw/conversion.py b/bilby/gw/conversion.py index 2c236e2a4..e1ea605c8 100644 --- a/bilby/gw/conversion.py +++ b/bilby/gw/conversion.py @@ -651,7 +651,7 @@ def lambda_1_lambda_2_to_lambda_tilde(lambda_1, lambda_2, mass_1, mass_2): Mass of less massive neutron star. Returns - ====== + ======= lambda_tilde: float Dominant tidal term. """ diff --git a/bilby/gw/detector/networks.py b/bilby/gw/detector/networks.py index 4f03b948b..22092649d 100644 --- a/bilby/gw/detector/networks.py +++ b/bilby/gw/detector/networks.py @@ -151,7 +151,7 @@ class InterferometerList(list): the segment. Notes - ========== + ===== if your signal takes a substantial amount of time to generate, or you experience buggy behaviour. It is preferable to provide the injection_polarizations directly. diff --git a/bilby/gw/detector/strain_data.py b/bilby/gw/detector/strain_data.py index ab04f07cc..f33b927a3 100644 --- a/bilby/gw/detector/strain_data.py +++ b/bilby/gw/detector/strain_data.py @@ -179,7 +179,7 @@ class InterferometerStrainData(object): into windowed part Returns - ====== + ======= window: array Window function over time array """ diff --git a/bilby/gw/prior.py b/bilby/gw/prior.py index ef67fddb0..824bd4d4e 100644 --- a/bilby/gw/prior.py +++ b/bilby/gw/prior.py @@ -800,7 +800,7 @@ class BBHPriorDict(CBCPriorDict): Disable logging in this function call. Default is False. Returns - ====== + ======= redundant: bool Whether the key is redundant or not """ diff --git a/bilby/gw/utils.py b/bilby/gw/utils.py index c975f915a..388f9aa15 100644 --- a/bilby/gw/utils.py +++ b/bilby/gw/utils.py @@ -210,7 +210,7 @@ def noise_weighted_inner_product(aa, bb, power_spectral_density, duration): duration of the data Returns - ====== + ======= Noise-weighted inner product. """ diff --git a/bilby/gw/waveform_generator.py b/bilby/gw/waveform_generator.py index 3ba1b317b..b068156fe 100644 --- a/bilby/gw/waveform_generator.py +++ b/bilby/gw/waveform_generator.py @@ -117,7 +117,7 @@ class WaveformGenerator(object): array_like: The frequency domain strain for the given set of parameters Raises - ======= + ====== RuntimeError: If no source model is given """ @@ -147,7 +147,7 @@ class WaveformGenerator(object): array_like: The time domain strain for the given set of parameters Raises - ======= + ====== RuntimeError: If no source model is given """ diff --git a/docs/bilby-mcmc-guide.txt b/docs/bilby-mcmc-guide.txt index 2a196db52..3b2346db3 100644 --- a/docs/bilby-mcmc-guide.txt +++ b/docs/bilby-mcmc-guide.txt @@ -7,6 +7,7 @@ Bilby MCMC Guide Bilby MCMC is a native sampler built directly in :code:`bilby` and described in `Ashton & Talbot (2021) <https://ui.adsabs.harvard.edu/abs/2021arXiv210608730A/abstract>`_. Here, we describe how to use it. +For detailed API information see the API section. Quickstart and output @@ -41,7 +42,7 @@ Configuration We now describe the configuration of the sampler. First, we will present a detailed look at some commonly-used parameters. But, please refer to the -full API at the end of this page for an exhaustive list. +full API for an exhaustive list. Here, we provide a code snippet to run :code:`bilby-mcmc` with parallel-tempering, and set the :code:`thin_by_nact` parameter. Note that, @@ -149,9 +150,4 @@ Note that the prior here is the prior as passed in to :code:`run_sampler`. >>> proposal_cycle = ProposalCycle(proposal_cycle_list) -New proposals can also be created by subclassing existing proposals. - -Full API --------- - -.. autoclass:: bilby.bilby_mcmc.sampler.Bilby_MCMC +New proposals can also be created by subclassing existing proposals. \ No newline at end of file -- GitLab