Skip to content

Commit d31d5ba

Browse files
authored
More CI (#3)
* Clean up patches * Add in the rest of the CI * exclude notebook 3 (for now)
1 parent ab95477 commit d31d5ba

File tree

6 files changed

+58
-58
lines changed

6 files changed

+58
-58
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
push:
88
branches:
99
- main
10-
#schedule:
11-
#- cron: "0 0 * * 0"
10+
schedule:
11+
- cron: "0 0 * * 0"
1212

1313
defaults:
1414
run:
@@ -38,10 +38,12 @@ jobs:
3838
conda info
3939
conda list
4040
- name: "Patch answers"
41-
run: |
42-
patch < .github/workflows/answers_1.patch
43-
patch < .github/workflows/answers_2.patch
44-
patch < .github/workflows/answers_3.patch
41+
run: source devtools/patch-all
42+
- name: "Download data"
43+
run: source devtools/download-files
4544
- name: "Run tests"
4645
run: |
47-
pytest --nbval-lax 1_tps_sampling_tutorial.ipynb
46+
pytest --nbval-lax \
47+
1_tps_sampling_tutorial.ipynb \
48+
2_tps_analysis_tutorial.ipynb \
49+
4_mstis_sampling_tutorial.ipynb
Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
11
diff --git a/2_tps_analysis_tutorial.ipynb b/2_tps_analysis_tutorial.ipynb
2-
index a6ab056..52b6e52 100644
2+
index 6d25bc4..b335e13 100644
33
--- a/2_tps_analysis_tutorial.ipynb
44
+++ b/2_tps_analysis_tutorial.ipynb
5-
@@ -137,9 +127,17 @@
6-
{
7-
"cell_type": "code",
8-
"execution_count": null,
9-
- "metadata": {
10-
- "collapsed": true
11-
- },
5+
@@ -122,6 +122,16 @@
6+
"#traj = storage.steps[####].active[0].trajectory"
7+
]
8+
},
9+
+ {
10+
+ "cell_type": "code",
11+
+ "execution_count": null,
1212
+ "metadata": {},
1313
+ "outputs": [],
1414
+ "source": [
15-
+ "### ANSWER \n",
15+
+ "### ANSWER\n",
1616
+ "traj = storage.steps[25].active[0].trajectory"
1717
+ ]
1818
+ },
19-
+ {
20-
+ "cell_type": "code",
21-
+ "execution_count": null,
22-
+ "metadata": {},
23-
"outputs": [],
24-
"source": [
25-
"md_traj = traj.to_mdtraj().image_molecules()\n",
26-
@@ -182,9 +178,45 @@
2719
{
2820
"cell_type": "code",
2921
"execution_count": null,
30-
- "metadata": {
31-
- "collapsed": true
32-
- },
22+
@@ -165,6 +175,44 @@
23+
"# Did your selected snapshot come from an accepted or rejected trial?"
24+
]
25+
},
26+
+ {
27+
+ "cell_type": "code",
28+
+ "execution_count": null,
3329
+ "metadata": {},
3430
+ "outputs": [],
3531
+ "source": [
@@ -65,20 +61,16 @@ index a6ab056..52b6e52 100644
6561
+ "print(step.change.accepted)"
6662
+ ]
6763
+ },
68-
+ {
69-
+ "cell_type": "code",
70-
+ "execution_count": null,
71-
+ "metadata": {},
72-
"outputs": [],
73-
"source": [
74-
"storage.close()"
75-
@@ -464,9 +474,18 @@
7664
{
7765
"cell_type": "code",
7866
"execution_count": null,
79-
- "metadata": {
80-
- "collapsed": true
81-
- },
67+
@@ -422,6 +470,17 @@
68+
"# trajB = flexible.steps[####].active[0].trajectory"
69+
]
70+
},
71+
+ {
72+
+ "cell_type": "code",
73+
+ "execution_count": null,
8274
+ "metadata": {},
8375
+ "outputs": [],
8476
+ "source": [
@@ -87,10 +79,6 @@ index a6ab056..52b6e52 100644
8779
+ "trajB = flexible.steps[8000].active[0].trajectory"
8880
+ ]
8981
+ },
90-
+ {
91-
+ "cell_type": "code",
92-
+ "execution_count": null,
93-
+ "metadata": {},
94-
"outputs": [],
95-
"source": [
96-
"ax = plotter.plot(xlim=(-np.pi, 0), ylim=(-np.pi/2, np.pi), cmap=\"Blues\")\n",
82+
{
83+
"cell_type": "code",
84+
"execution_count": null,
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
diff --git a/3_committor_analysis_tutorial.ipynb b/3_committor_analysis_tutorial.ipynb
2-
index 449afa4..c7c5b97 100644
2+
index 6cbc363..957f0ab 100644
33
--- a/3_committor_analysis_tutorial.ipynb
44
+++ b/3_committor_analysis_tutorial.ipynb
5-
@@ -174,15 +161,29 @@
6-
{
7-
"cell_type": "code",
8-
"execution_count": null,
9-
- "metadata": {
10-
- "collapsed": true
11-
- },
12-
+ "metadata": {},
13-
"outputs": [],
14-
"source": [
15-
"# YOUR TURN: Do the same for the psi variable.\n",
5+
@@ -168,6 +168,22 @@
166
"# Remember to start by creating a `psi_hash`."
177
]
188
},
@@ -29,7 +19,7 @@ index 449afa4..c7c5b97 100644
2919
+ "bin_widths = [psi_bins[i+1]-psi_bins[i] for i in range(len(psi_bins)-1)]\n",
3020
+ "plt.bar(x=psi_bins[:-1], height=hist1D, width=bin_widths)\n",
3121
+ "plt.xlabel(\"$\\psi$\")\n",
32-
+ "plt.ylabel(\"$p_B$\");"
22+
+ "plt.ylabel(\"$p_B$\")"
3323
+ ]
3424
+ },
3525
{

devtools/download-files

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
figshare_ID=4763686
4+
version=1
5+
6+
mkdir $figshare_ID
7+
curl -Lk -o ${figshare_ID}.zip \
8+
https://ndownloader.figshare.com/articles/${figshare_ID}/versions/$version
9+
unzip -d $figshare_ID ${figshare_ID}.zip
10+
11+
mv $figshare_ID/* ./

devtools/patch-all

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4+
5+
patch < ${DIR}/a1.patch
6+
patch < ${DIR}/a2.patch
7+
patch < ${DIR}/a3.patch
8+
#patch < ${DIR}/testing.patch
9+

0 commit comments

Comments
 (0)