Skip to content

Commit

Permalink
MBAR verbosity and some bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
craabreu committed Nov 23, 2018
1 parent bbd4414 commit 49bbf88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/mics/MBAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def __initialize__(self, mixture):

mb = self.MBAR = mbar.MBAR(np.hstack(mixture.u), n,
relative_tolerance=self.tol,
initial_f_k=mixture.f)
initial_f_k=mixture.f,
verbose=mics.verbose)

mixture.f = mb.f_k
mics.verbose and info("Free energies after convergence:", mixture.f)
Expand Down
5 changes: 2 additions & 3 deletions src/mics/mixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,9 @@ def pmf(self, potential, property, bins=10, interval=None, **constants):
zc = zmin + delta*(i + 0.5)
mics.verbose and info("Bin[%d]:" % (i + 1), "%s = %s" % (property, str(zc)))
y = [np.equal(x, i).astype(np.float) for x in ibin]
yu, Theta = self.__reweight__(u, y)
(yu, Theta) = self.engine.__reweight__(self, u, y)
if yu[1] > 0.0:
dyu = np.sqrt(Theta[1, 1])
print([zc, -np.log(yu[1]), dyu/yu[1]])
results.append([zc, -np.log(yu[1]), dyu/yu[1]])

return pd.DataFrame(results, columns=[property, "pmf", errorTitle("pmf")])
Expand All @@ -270,7 +269,7 @@ def histograms(self, property="u0", bins=100, **constants):
elif property == "potential":
y = [self.u[i][i, :] for i in range(self.m)]
else:
y = self.compute(property, constants)
y = self.__compute__(property, constants)
ymin = min([np.amin(x) for x in y])
ymax = max([np.amax(x) for x in y])
delta = (ymax - ymin)/bins
Expand Down
2 changes: 1 addition & 1 deletion src/mics/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def subsampling(self, integratedACF=True):
"""
n = len(self.dataset)
if mics.verbose:
info("\n=== Subsampling via %s ===" % "integrated ACF" if integratedACF else "OBM")
info("\n=== Subsampling via %s ===" % ("integrated ACF" if integratedACF else "OBM"))
info("Original sample size:", n)
if integratedACF:
y = multimap([self.acfun.lambdify()], self.dataset)
Expand Down

0 comments on commit 49bbf88

Please sign in to comment.