Skip to content

Commit

Permalink
deprecating 'threads'
Browse files Browse the repository at this point in the history
  • Loading branch information
dfm committed Oct 5, 2017
1 parent 29725b0 commit 93d4645
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions emcee/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class EnsembleSampler(Sampler):
:param postargs: (optional)
Alias of ``args`` for backwards compatibility.
:param threads: (optional)
:param threads: (deprecated; ignored)
The number of threads to use for parallelization. If ``threads == 1``,
then the ``multiprocessing`` module is not used but if
``threads > 1``, then a ``Pool`` object is created and calls to
Expand All @@ -78,11 +78,14 @@ class EnsembleSampler(Sampler):
"""
def __init__(self, nwalkers, dim, lnpostfn, a=2.0, args=[], kwargs={},
postargs=None, threads=1, pool=None, live_dangerously=False,
postargs=None, threads=None, pool=None, live_dangerously=False,
runtime_sortingfn=None):
if threads is not None:
logging.warn("the 'threads' argument is deprecated; "
"use 'pool' instead")

self.k = nwalkers
self.a = a
self.threads = threads
self.pool = pool
self.runtime_sortingfn = runtime_sortingfn

Expand All @@ -103,9 +106,6 @@ def __init__(self, nwalkers, dim, lnpostfn, a=2.0, args=[], kwargs={},
"dimension of your parameter space unless you know what "
"you're getting yourself into...")

if self.threads > 1 and self.pool is None:
self.pool = InterruptiblePool(self.threads)

def clear_blobs(self):
"""
Clear the ``blobs`` list.
Expand Down

0 comments on commit 93d4645

Please sign in to comment.