Skip to content

Commit

Permalink
Issue docstring harmonic (#541)
Browse files Browse the repository at this point in the history
* Remove tracking of project settings

* Fix docstring for HarmonicOscillator

* black

* Fix bar ParameterError
  • Loading branch information
jaclark5 authored Sep 30, 2024
1 parent 76664b7 commit 9091c3f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ venv.bak/
.spyderproject
.spyproject

# VSCode project settings
.vscode/

# Rope project settings
.ropeproject

Expand Down
5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion pymbar/other_estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def bar(
DeltaF_initial = DeltaF

if method not in ["self-consistent-iteration", "false-position", "bisection"]:
raise ParameterError("method {:d} is not defined for bar".format(method))
raise ParameterError("method {} is not defined for bar".format(method))

if uncertainty_method not in ["BAR", "MBAR"]:
raise ParameterError(
Expand Down
10 changes: 6 additions & 4 deletions pymbar/testsystems/harmonic_oscillators.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class HarmonicOscillatorsTestCase(object):
Generate energy samples with default parameters.
>>> testcase = HarmonicOscillatorsTestCase()
>>> x_kn, u_kln, N_k, s_n = testcase.sample()
>>> x_n, u_kn, N_k, s_n = testcase.sample()
Retrieve analytical properties.
Expand All @@ -22,12 +22,12 @@ class HarmonicOscillatorsTestCase(object):
Generate energy samples with default parameters in one line.
>>> x_kn, u_kln, N_k, s_n = HarmonicOscillatorsTestCase().sample()
>>> x_n, u_kn, N_k, s_n = HarmonicOscillatorsTestCase().sample()
Generate energy samples with specified parameters.
>>> testcase = HarmonicOscillatorsTestCase(O_k=[0, 1, 2, 3, 4], K_k=[1, 2, 4, 8, 16])
>>> x_kn, u_kln, N_k, s_n = testcase.sample(N_k=[10, 20, 30, 40, 50])
>>> x_n, u_kn, N_k, s_n = testcase.sample(N_k=[10, 20, 30, 40, 50])
Test sampling in different output modes.
Expand Down Expand Up @@ -131,9 +131,11 @@ def sample(self, N_k=(10, 20, 30, 40, 50), mode="u_kn", seed=None):
s_n : np.ndarray, shape=(n_samples), dtype='int'
s_n is the state of origin of x_n
if mode == 'u_kln':
x_kn : np.ndarray, shape=(n_states, n_samples), dtype=float
1D harmonic oscillator positions
u_kln : np.ndarray, shape=(n_states, n_states, n_samples), dytpe=float, only if mode='u_kln'
u_kln : np.ndarray, shape=(n_states, n_states, n_samples), dytpe=float
u_kln[k,l,n] is reduced potential of sample n from state k evaluated at state l.
N_k : np.ndarray, shape=(n_states), dtype=int32
N_k[k] is the number of samples generated from state k
Expand Down

0 comments on commit 9091c3f

Please sign in to comment.