Skip to content

Commit 9592ca2

Browse files
committed
formatting
1 parent 09234ca commit 9592ca2

6 files changed

Lines changed: 18 additions & 16 deletions

File tree

py/dynesty/dynamicsampler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,8 @@ def __init__(self,
712712
# internal sampler object
713713
self.sampler = None
714714

715-
self.bound_enlarge, self.bound_bootstrap = bound_enlarge, bound_bootstrap
715+
self.bound_enlarge, self.bound_bootstrap = (bound_enlarge,
716+
bound_bootstrap)
716717

717718
# TODO FIX
718719
# self.cite = self.kwargs.get('cite')
@@ -909,7 +910,7 @@ def citations(self):
909910
"""
910911

911912
# TODO REMOVE
912-
return [] ## self.cite
913+
return [] # self.cite
913914

914915
def sample_initial(self,
915916
nlive=None,

py/dynesty/dynesty.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
import traceback
1313
import numpy as np
1414
from .sampling import (INTERNAL_SAMPLER_LIST, InternalSampler, RSliceSampler,
15-
UniformBoundSampler, UnitCubeSampler, RWalkSampler,
16-
SliceSampler)
15+
UniformBoundSampler, RWalkSampler, SliceSampler)
1716
from .sampler import Sampler, _initialize_live_points
1817
from .bounding import BOUND_LIST
1918
from . import bounding
@@ -246,8 +245,8 @@ def _get_update_interval_ratio(update_interval, sample, nlive):
246245
else:
247246
update_interval_ratio = 1
248247
warnings.warn(
249-
"No update_interval set with unknown sampling method: "
250-
f"'. Defaulting to no 1 update per nlive points.")
248+
"No update_interval set with unknown sampling method."
249+
". Defaulting to no 1 update per nlive points.")
251250
elif isinstance(update_interval, float):
252251
update_interval_ratio = update_interval
253252
elif isinstance(update_interval, int):

py/dynesty/pool.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ class Pool:
9090
To use the dynesty pool you have to use it with the context manager::
9191
9292
with dynesty.pool.Pool(16, loglike, prior_transform) as pool:
93-
dns = DynamicNestedSampler(pool.loglike, pool.prior_transform, ndim,
94-
pool=pool)
93+
dns = DynamicNestedSampler(pool.loglike, pool.prior_transform,
94+
ndim, pool=pool)
9595
9696
Also note that you have to provide the .loglike/.prior_transform attributes
9797
from the pool object to the Nested samper rather than your original
@@ -100,14 +100,14 @@ class Pool:
100100
If your likelihood function takes additional arguments, it is better to
101101
pass them when creating the pool, rather then to nested sampler::
102102
103-
with dynesty.pool.Pool(16, loglike, prior_transform,
103+
with dynesty.pool.Pool(16, loglike, prior_transform,
104104
logl_args=(...) ) as pool:
105-
dns = DynamicNestedSampler(pool.loglike, pool.prior_transform, ndim,
106-
pool=pool)
105+
dns = DynamicNestedSampler(pool.loglike, pool.prior_transform,
106+
ndim, pool=pool)
107107
108108
as this way they will not need to be pickled and unpickled every function
109109
call.
110-
110+
111111
Note though that if you specify logl_args, and ptform_args when creating
112112
the Pool *AND* in the sampler those will be concatenated
113113
"""

py/dynesty/sampler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ class Sampler:
270270
271271
live_points : list of 3 or 4 `~numpy.ndarray`
272272
Each with shape (nlive, ndim) for the first three arrays.
273-
If `blob=True`, a fourth array of blobs (arbitrary shape) may be included.
273+
If `blob=True`, a fourth array of blobs (arbitrary shape) may be
274+
included.
274275
275276
sampling : {`'unif'`, `'rwalk'`, `'slice'`, `'rslice'`}
276277
Sampling Method used to sample uniformly within the likelihood

py/dynesty/sampling.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ def _new_from_template(self, template_kwargs):
9797
template_kwargs1[k] = v
9898
else:
9999
if template_kwargs1[k] != self.input_kwargs[k]:
100-
warnings.warn(f"Incompatible sampler parameters: {template_kwargs1[k]} vs {self.input_kwargs[k]}")
100+
warnings.warn(
101+
"Incompatible sampler parameters: "
102+
f"{template_kwargs1[k]} vs {self.input_kwargs[k]}")
101103
return self.__class__(**template_kwargs1)
102104

103105
def prepare_sampler(self,

py/dynesty/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
__all__ = [
3333
"unitcheck", "resample_equal", "mean_and_cov", "quantile", "jitter_run",
3434
"resample_run", "reweight_run", "unravel_run", "merge_runs", "kld_error",
35-
"get_enlarge_bootstrap", "LoglOutput", "LogLikelihood", "RunRecord",
36-
"DelayTimer"
35+
"LoglOutput", "LogLikelihood", "RunRecord", "DelayTimer"
3736
]
3837

3938
SQRTEPS = math.sqrt(float(np.finfo(np.float64).eps))

0 commit comments

Comments
 (0)