Skip to content

Commit 99488a3

Browse files
authored
Merge pull request #22 from dwhswenson/fix-openmm81
Fix NB 2 for OpenMM 8.1
2 parents 6fe168e + 1ffb6cb commit 99488a3

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

.github/workflows/ci.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ jobs:
2121
strategy:
2222
matrix:
2323
CONDA_PY:
24-
- 3.7
25-
- 3.8
26-
- 3.9
24+
- "3.8"
25+
- "3.9"
26+
- "3.10"
27+
#- "3.11"
2728

2829
steps:
2930
- uses: actions/checkout@v2
@@ -59,9 +60,10 @@ jobs:
5960
strategy:
6061
matrix:
6162
CONDA_PY:
62-
- 3.7
63-
- 3.8
64-
- 3.9
63+
- "3.8"
64+
- "3.9"
65+
- "3.10"
66+
#- "3.11"
6567

6668
steps:
6769
- uses: actions/checkout@v2

2_tps_analysis_tutorial.ipynb

+9-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"import openpathsampling.visualize as ops_vis\n",
4343
"from IPython.display import SVG\n",
4444
"\n",
45-
"import nglview as nv"
45+
"import nglview as nv\n",
46+
"import openmm"
4647
]
4748
},
4849
{
@@ -327,10 +328,13 @@
327328
"metadata": {},
328329
"outputs": [],
329330
"source": [
331+
"# with OpenMM 8.0 or earlier: timestep = engine.snapshot_timestep\n",
332+
"# (also should work for data generated with OpenMM 8.1 or later)\n",
333+
"timestep = 2.0 * openmm.unit.femtosecond\n",
330334
"path_lengths = [len(step.active[0].trajectory) for step in flexible.steps]\n",
331335
"plt.hist(path_lengths, bins=40, alpha=0.5);\n",
332-
"print(\"Maximum:\", max(path_lengths), \"(\"+str(max(path_lengths)*engine.snapshot_timestep)+\")\")\n",
333-
"print(\"Average:\", \"{0:.2f}\".format(np.mean(path_lengths)), \"(\"+(np.mean(path_lengths)*engine.snapshot_timestep).format(\"%.3f\")+\")\")\n",
336+
"print(\"Maximum:\", max(path_lengths), \"(\"+str(max(path_lengths)*timestep)+\")\")\n",
337+
"print(\"Average:\", \"{0:.2f}\".format(np.mean(path_lengths)), \"(\"+(np.mean(path_lengths)*timestep).format(\"%.3f\")+\")\")\n",
334338
"plt.ylabel(\"Count\")\n",
335339
"plt.xlabel(\"Path length (Frames)\");"
336340
]
@@ -468,7 +472,7 @@
468472
],
469473
"metadata": {
470474
"kernelspec": {
471-
"display_name": "Python 3",
475+
"display_name": "Python 3 (ipykernel)",
472476
"language": "python",
473477
"name": "python3"
474478
},
@@ -482,7 +486,7 @@
482486
"name": "python",
483487
"nbconvert_exporter": "python",
484488
"pygments_lexer": "ipython3",
485-
"version": "3.7.10"
489+
"version": "3.9.13"
486490
},
487491
"toc": {
488492
"base_numbering": 1,

4_mstis_sampling_tutorial.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
" filename = \"./inputs/mstis_bootstrap_py2.nc\"\n",
223223
"elif (3, 6) <= sys.version_info < (3, 8):\n",
224224
" filename = \"./inputs/mstis_bootstrap_py3.nc\"\n",
225-
"elif (3, 8) <= sys.version_info < (3, 10):\n",
225+
"elif (3, 8) <= sys.version_info < (3, 11):\n",
226226
" filename = \"./inputs/mstis_bootstrap_py38.nc\"\n",
227227
"else:\n",
228228
" raise RuntimeError(\n",
@@ -599,7 +599,7 @@
599599
"metadata": {
600600
"anaconda-cloud": {},
601601
"kernelspec": {
602-
"display_name": "Python 3",
602+
"display_name": "Python 3 (ipykernel)",
603603
"language": "python",
604604
"name": "python3"
605605
},
@@ -613,7 +613,7 @@
613613
"name": "python",
614614
"nbconvert_exporter": "python",
615615
"pygments_lexer": "ipython3",
616-
"version": "3.8.10"
616+
"version": "3.9.13"
617617
},
618618
"toc": {
619619
"base_numbering": 1,

0 commit comments

Comments
 (0)