From 9091c3f9e4648111a7b36e0c5fdf1a7202d200b3 Mon Sep 17 00:00:00 2001 From: Jennifer A Clark Date: Mon, 30 Sep 2024 19:25:35 -0400 Subject: [PATCH] Issue docstring harmonic (#541) * Remove tracking of project settings * Fix docstring for HarmonicOscillator * black * Fix bar ParameterError --- .gitignore | 3 +++ .vscode/settings.json | 5 ----- pymbar/other_estimators.py | 2 +- pymbar/testsystems/harmonic_oscillators.py | 10 ++++++---- 4 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 6b353eff..cb5a29e5 100644 --- a/.gitignore +++ b/.gitignore @@ -118,6 +118,9 @@ venv.bak/ .spyderproject .spyproject +# VSCode project settings +.vscode/ + # Rope project settings .ropeproject diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 36fe635c..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "python.linting.enabled": true, - "python.linting.pylintEnabled": true, - "python.pythonPath": "/home/jaime/.conda/envs/pymbar/bin/python" -} \ No newline at end of file diff --git a/pymbar/other_estimators.py b/pymbar/other_estimators.py index d9539df0..1796823f 100644 --- a/pymbar/other_estimators.py +++ b/pymbar/other_estimators.py @@ -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( diff --git a/pymbar/testsystems/harmonic_oscillators.py b/pymbar/testsystems/harmonic_oscillators.py index 32ac4cd6..7a1862bf 100644 --- a/pymbar/testsystems/harmonic_oscillators.py +++ b/pymbar/testsystems/harmonic_oscillators.py @@ -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. @@ -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. @@ -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