Skip to content

Commit

Permalink
Fixed example bug and updated output. (#513)
Browse files Browse the repository at this point in the history
* Fixed example bug and updated output.

fixed a bug in the harmonic_oscillators.py example that wasn't actually
retrieving the data from the results object for reverse exponential averaging.

Added logging to the two harmonic oscillator files.

Update the output of the example scripts since they were quite old.

* format fixes for black

* fix doc building

* we need to add html_theme since that gets injected later by RTD

---------

Co-authored-by: Mike Henry <[email protected]>
  • Loading branch information
mrshirts and mikemhenry authored Aug 24, 2023
1 parent 7b4f89f commit e5b7f12
Show file tree
Hide file tree
Showing 10 changed files with 2,345 additions and 1,516 deletions.
3 changes: 2 additions & 1 deletion devtools/conda-envs/test_env_jax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ dependencies:
- xlrd
# Docs
- numpydoc
- sphinx <7
- sphinx
- sphinx-rtd-theme
- sphinxcontrib-bibtex
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
# a list of builtin themes.
# html_theme = "default"
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

html_theme = "sphinx_rtd_theme"
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme

Expand Down
Binary file modified examples/harmonic-oscillators/QQMBARobserve.pdf
Binary file not shown.
Binary file modified examples/harmonic-oscillators/QQdf.pdf
Binary file not shown.
Binary file modified examples/harmonic-oscillators/QQstandardobserve.pdf
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
from pymbar import testsystems, MBAR, confidenceintervals
from pymbar.utils import ParameterError, DataError

import logging
import sys

logging.basicConfig(stream=sys.stdout, level=logging.INFO)

# =============================================================================================
# PARAMETERS
# =============================================================================================
Expand Down
2,422 changes: 1,418 additions & 1,004 deletions examples/harmonic-oscillators/harmonic-oscillators-distributions.py_output.txt

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions examples/harmonic-oscillators/harmonic-oscillators.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
from pymbar import testsystems, exp, exp_gauss, bar, MBAR, FES
from pymbar.utils import ParameterError

import logging
import sys

logging.basicConfig(stream=sys.stdout, level=logging.INFO)

# =============================================================================================
# HELPER FUNCTIONS
# =============================================================================================
Expand Down Expand Up @@ -219,7 +224,7 @@ def get_analytical(beta, K, O, observables):
for k in range(1, K):
if N_k[k] != 0:
w_R = u_kln[k, k - 1, 0 : N_k[k]] - u_kln[k, k, 0 : N_k[k]] # reverse work
df_exp, ddf_exp = exp(w_R)
results = exp(w_R)
df_exp = -results["Delta_f"]
ddf_exp = results["dDelta_f"]
exp_analytical = f_k_analytical[k] - f_k_analytical[k - 1]
Expand Down Expand Up @@ -805,7 +810,7 @@ def generate_fes_data(
# Compute fre energy profile, first with histograms
print("Solving for free energies of state to initialize free energy profile...")
mbar_options = dict()
mbar_options["verbose"] = True
mbar_options["verbose"] = False
fes = FES(u_kn, N_k, mbar_options=mbar_options)
print("Computing free energy profile ...")
histogram_parameters = dict()
Expand Down
1,420 changes: 912 additions & 508 deletions examples/harmonic-oscillators/harmonic-oscillators.py_output.txt

Large diffs are not rendered by default.

0 comments on commit e5b7f12

Please sign in to comment.