Skip to content

Commit

Permalink
Merge pull request #37 from msat59/master
Browse files Browse the repository at this point in the history
Empty progress bar fixed
  • Loading branch information
cokelaer authored Jul 22, 2021
2 parents cda140d + e27b80a commit b96463b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fitter/fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def _init(self):
self._bic = {}
self._kldiv = {}
self._fit_i = 0 # fit progress
self.pb = Progress(len(self.distributions))
self.pb = None

def _update_data_pdf(self):
# histogram retuns X with N+1 values. So, we rearrange the X output into only N
Expand Down Expand Up @@ -317,6 +317,9 @@ def fit(self, amp=1, progress=False, n_jobs=-1):
"""
import warnings
warnings.filterwarnings("ignore", category=RuntimeWarning)

if progress:
self.pb = Progress(len(self.distributions))

jobs = (delayed(self._fit_single_distribution)(dist, progress) for dist in self.distributions)
pool = Parallel(n_jobs=n_jobs, backend='threading')
Expand Down

0 comments on commit b96463b

Please sign in to comment.