Skip to content

Commit b67772f

Browse files
authored
adding colab installs to some notebooks (#205)
1 parent 953014f commit b67772f

File tree

4 files changed

+204
-0
lines changed

4 files changed

+204
-0
lines changed

abfe_tutorial/python_tutorial.ipynb

+51
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,57 @@
2222
"## <img src=\"abfe-cycle.png\" alt=\"Drawing\" style=\"width: 400px;\"/>"
2323
]
2424
},
25+
{
26+
"cell_type": "markdown",
27+
"id": "f9154ba7",
28+
"metadata": {},
29+
"source": [
30+
"# 0. Setup for Google Colab\n",
31+
"\n",
32+
"If you are running this example in Google Colab, run the following cells to setup the environment. If you are running this notebook locally, skip down to `1. Overview`"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": null,
38+
"id": "6173dd67",
39+
"metadata": {},
40+
"outputs": [],
41+
"source": [
42+
"# NBVAL_SKIP\n",
43+
"# Only run this cell if on google colab\n",
44+
"import os\n",
45+
"if \"COLAB_RELEASE_TAG\" in os.environ:\n",
46+
" !pip install -q condacolab\n",
47+
" import condacolab\n",
48+
" condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/ExampleNotebooks/releases/download/april-2025/OpenFEforge-1.5.0.dev0-Linux-x86_64.sh\")"
49+
]
50+
},
51+
{
52+
"cell_type": "code",
53+
"execution_count": null,
54+
"id": "2e888557",
55+
"metadata": {},
56+
"outputs": [],
57+
"source": [
58+
"# NBVAL_SKIP\n",
59+
"# Only run this cell if on google colab\n",
60+
"import os\n",
61+
"if \"COLAB_RELEASE_TAG\" in os.environ:\n",
62+
" import condacolab\n",
63+
" import locale\n",
64+
" locale.getpreferredencoding = lambda: \"UTF-8\"\n",
65+
" !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n",
66+
" for _ in range(3):\n",
67+
" # Sometimes we have to re-run the check\n",
68+
" try:\n",
69+
" condacolab.check()\n",
70+
" except:\n",
71+
" pass\n",
72+
" else:\n",
73+
" break"
74+
]
75+
},
2576
{
2677
"cell_type": "code",
2778
"execution_count": 1,

ahfe_tutorial/python_tutorial.ipynb

+51
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,57 @@
2222
"## <img src=\"ahfe_cycle.png\" alt=\"Drawing\" style=\"width: 300px;\"/>"
2323
]
2424
},
25+
{
26+
"cell_type": "markdown",
27+
"id": "e26c8170",
28+
"metadata": {},
29+
"source": [
30+
"# 0. Setup for Google Colab\n",
31+
"\n",
32+
"If you are running this example in Google Colab, run the following cells to setup the environment. If you are running this notebook locally, skip down to `1. Overview`"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": null,
38+
"id": "525ac910",
39+
"metadata": {},
40+
"outputs": [],
41+
"source": [
42+
"# NBVAL_SKIP\n",
43+
"# Only run this cell if on google colab\n",
44+
"import os\n",
45+
"if \"COLAB_RELEASE_TAG\" in os.environ:\n",
46+
" !pip install -q condacolab\n",
47+
" import condacolab\n",
48+
" condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/ExampleNotebooks/releases/download/april-2025/OpenFEforge-1.5.0.dev0-Linux-x86_64.sh\")"
49+
]
50+
},
51+
{
52+
"cell_type": "code",
53+
"execution_count": null,
54+
"id": "808ba76a",
55+
"metadata": {},
56+
"outputs": [],
57+
"source": [
58+
"# NBVAL_SKIP\n",
59+
"# Only run this cell if on google colab\n",
60+
"import os\n",
61+
"if \"COLAB_RELEASE_TAG\" in os.environ:\n",
62+
" import condacolab\n",
63+
" import locale\n",
64+
" locale.getpreferredencoding = lambda: \"UTF-8\"\n",
65+
" !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n",
66+
" for _ in range(3):\n",
67+
" # Sometimes we have to re-run the check\n",
68+
" try:\n",
69+
" condacolab.check()\n",
70+
" except:\n",
71+
" pass\n",
72+
" else:\n",
73+
" break"
74+
]
75+
},
2576
{
2677
"cell_type": "code",
2778
"execution_count": 1,

openmm_md/plain_md.ipynb

+51
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,57 @@
6464
"| 7. NPT production (if not gas phase) | OpenFE - OpenMM + OpenMMTools | Simulation trajectory (`simulation.xtc`), Checkpoint file (`checkpoint.chk`), Log output (`simulation.log`) |\n"
6565
]
6666
},
67+
{
68+
"cell_type": "markdown",
69+
"id": "fc27c86c",
70+
"metadata": {},
71+
"source": [
72+
"# 0. Setup for Google Colab\n",
73+
"\n",
74+
"If you are running this example in Google Colab, run the following cells to setup the environment. If you are running this notebook locally, skip down to `1. Overview`"
75+
]
76+
},
77+
{
78+
"cell_type": "code",
79+
"execution_count": null,
80+
"id": "6559bc05",
81+
"metadata": {},
82+
"outputs": [],
83+
"source": [
84+
"# NBVAL_SKIP\n",
85+
"# Only run this cell if on google colab\n",
86+
"import os\n",
87+
"if \"COLAB_RELEASE_TAG\" in os.environ:\n",
88+
" !pip install -q condacolab\n",
89+
" import condacolab\n",
90+
" condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/ExampleNotebooks/releases/download/april-2025/OpenFEforge-1.5.0.dev0-Linux-x86_64.sh\")"
91+
]
92+
},
93+
{
94+
"cell_type": "code",
95+
"execution_count": null,
96+
"id": "eb1368ca",
97+
"metadata": {},
98+
"outputs": [],
99+
"source": [
100+
"# NBVAL_SKIP\n",
101+
"# Only run this cell if on google colab\n",
102+
"import os\n",
103+
"if \"COLAB_RELEASE_TAG\" in os.environ:\n",
104+
" import condacolab\n",
105+
" import locale\n",
106+
" locale.getpreferredencoding = lambda: \"UTF-8\"\n",
107+
" !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n",
108+
" for _ in range(3):\n",
109+
" # Sometimes we have to re-run the check\n",
110+
" try:\n",
111+
" condacolab.check()\n",
112+
" except:\n",
113+
" pass\n",
114+
" else:\n",
115+
" break"
116+
]
117+
},
67118
{
68119
"cell_type": "markdown",
69120
"id": "0eb8203a-650f-4703-b032-dbafb605061b",

plotting_rbfes_with_cinnabar/PlottingFreeEnergiesUsingCinnabar.ipynb

+51
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,57 @@
1010
"This notebook shows how one would go about creating a cinnabar plot of OpenFE results against known experimental values."
1111
]
1212
},
13+
{
14+
"cell_type": "markdown",
15+
"id": "6f3d03c2",
16+
"metadata": {},
17+
"source": [
18+
"# 0. Setup for Google Colab\n",
19+
"\n",
20+
"If you are running this example in Google Colab, run the following cells to setup the environment. If you are running this notebook locally, skip down to `1. Overview`"
21+
]
22+
},
23+
{
24+
"cell_type": "code",
25+
"execution_count": null,
26+
"id": "04aa17bf",
27+
"metadata": {},
28+
"outputs": [],
29+
"source": [
30+
"# NBVAL_SKIP\n",
31+
"# Only run this cell if on google colab\n",
32+
"import os\n",
33+
"if \"COLAB_RELEASE_TAG\" in os.environ:\n",
34+
" !pip install -q condacolab\n",
35+
" import condacolab\n",
36+
" condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/ExampleNotebooks/releases/download/april-2025/OpenFEforge-1.5.0.dev0-Linux-x86_64.sh\")"
37+
]
38+
},
39+
{
40+
"cell_type": "code",
41+
"execution_count": null,
42+
"id": "6d297968",
43+
"metadata": {},
44+
"outputs": [],
45+
"source": [
46+
"# NBVAL_SKIP\n",
47+
"# Only run this cell if on google colab\n",
48+
"import os\n",
49+
"if \"COLAB_RELEASE_TAG\" in os.environ:\n",
50+
" import condacolab\n",
51+
" import locale\n",
52+
" locale.getpreferredencoding = lambda: \"UTF-8\"\n",
53+
" !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n",
54+
" for _ in range(3):\n",
55+
" # Sometimes we have to re-run the check\n",
56+
" try:\n",
57+
" condacolab.check()\n",
58+
" except:\n",
59+
" pass\n",
60+
" else:\n",
61+
" break"
62+
]
63+
},
1364
{
1465
"cell_type": "code",
1566
"execution_count": 1,

0 commit comments

Comments
 (0)