From b47484944688d89d0db0c6082b2350dc2bb8efc5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 2 Jun 2024 05:39:19 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/emcee/moves/dime.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/emcee/moves/dime.py b/src/emcee/moves/dime.py index 3e25b80b..3abacec2 100644 --- a/src/emcee/moves/dime.py +++ b/src/emcee/moves/dime.py @@ -52,7 +52,13 @@ class DIMEMove(RedBlueMove): """ def __init__( - self, sigma=1.0e-5, gamma=None, aimh_prob=0.1, df_proposal_dist=10, rho=.999, **kwargs + self, + sigma=1.0e-5, + gamma=None, + aimh_prob=0.1, + df_proposal_dist=10, + rho=0.999, + **kwargs ): if multivariate_t is None: raise ImportError( @@ -87,8 +93,7 @@ def setup(self, coords): self.update_proposal_dist(coords) def propose(self, model, state): - """Wrap original propose to get the some info on the current state - """ + """Wrap original propose to get the some info on the current state""" self.lprobs = state.log_prob state, accepted = super(DIMEMove, self).propose(model, state) @@ -96,15 +101,17 @@ def propose(self, model, state): return state, accepted def update_proposal_dist(self, x): - """Update proposal distribution with ensemble `x` - """ + """Update proposal distribution with ensemble `x`""" nchain, npar = x.shape # log weight of current ensemble if self.accepted.any(): - lweight = logsumexp(self.lprobs) + \ - np.log(sum(self.accepted)) - np.log(nchain) + lweight = ( + logsumexp(self.lprobs) + + np.log(sum(self.accepted)) + - np.log(nchain) + ) else: lweight = -np.inf @@ -126,8 +133,7 @@ def update_proposal_dist(self, x): self.cumlweight = newcumlweight def get_proposal(self, x, xref, random): - """Actual proposal function - """ + """Actual proposal function""" xref = xref[0] nchain, npar = x.shape