Skip to content

Commit 9bb3c84

Browse files
committed
Fix tutorial data for Colab
1 parent 2af12b3 commit 9bb3c84

File tree

3 files changed

+43
-24
lines changed

3 files changed

+43
-24
lines changed

docs/source/tutorials/cli/geomopt.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"from ase.io import write\n",
9494
"from weas_widget import WeasWidget\n",
9595
"\n",
96-
"Path(\"data\").mkdir(exist_ok=True)\n",
96+
"Path(\"../data\").mkdir(exist_ok=True)\n",
9797
"\n",
9898
"NaCl = bulk(\"NaCl\", \"rocksalt\", a=5.63, cubic=True)\n",
9999
"NaCl[0].position = [1.5, 1.5, 1.5]\n",

docs/source/tutorials/cli/md.ipynb

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@
4444
"# get_ipython().kernel.do_shutdown(restart=True)"
4545
]
4646
},
47+
{
48+
"cell_type": "code",
49+
"execution_count": null,
50+
"metadata": {},
51+
"outputs": [],
52+
"source": [
53+
"# from data_tutorials.data import get_data\n",
54+
"\n",
55+
"# get_data(\n",
56+
"# url=\"https://raw.githubusercontent.com/stfc/janus-core/main/docs/source/tutorials/data/\",\n",
57+
"# filename=[\"NaCl-1040.extxyz\"],\n",
58+
"# folder=\"../data\",\n",
59+
"# )"
60+
]
61+
},
4762
{
4863
"cell_type": "code",
4964
"execution_count": null,
@@ -52,15 +67,17 @@
5267
},
5368
"outputs": [],
5469
"source": [
70+
"from pathlib import Path\n",
71+
"\n",
5572
"from ase.build import bulk\n",
5673
"from ase.io import read, write\n",
74+
"import numpy as np\n",
75+
"import matplotlib.pyplot as plt\n",
5776
"from weas_widget import WeasWidget\n",
58-
"from janus_core.helpers.stats import Stats\n",
59-
"from janus_core.processing import post_process\n",
6077
"import yaml\n",
6178
"\n",
62-
"import numpy as np\n",
63-
"import matplotlib.pyplot as plt"
79+
"from janus_core.helpers.stats import Stats\n",
80+
"from janus_core.processing import post_process"
6481
]
6582
},
6683
{
@@ -80,6 +97,8 @@
8097
"metadata": {},
8198
"outputs": [],
8299
"source": [
100+
"Path(\"../data\").mkdir(exist_ok=True)\n",
101+
"\n",
83102
"NaCl = bulk(\"NaCl\", \"rocksalt\", a=5.63, cubic=True)\n",
84103
"NaCl = NaCl * (2, 2, 2)\n",
85104
"write(\"../data/NaCl.xyz\", NaCl)\n",

docs/source/tutorials/python/neb.ipynb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,45 +36,45 @@
3636
"cell_type": "markdown",
3737
"metadata": {},
3838
"source": [
39-
"You can toggle the following to investigate different models:"
39+
"## Set up environment (optional)\n",
40+
"\n",
41+
"These steps are required for Google Colab, but may work on other systems too:"
4042
]
4143
},
4244
{
4345
"cell_type": "code",
4446
"execution_count": null,
45-
"metadata": {},
47+
"metadata": {
48+
"id": "TF-EiWxyuMc7"
49+
},
4650
"outputs": [],
4751
"source": [
48-
"model_params = {\"arch\": \"mace_mp\", \"model\": \"medium-0b3\"}\n",
49-
"# model_params = {\"arch\": \"mace_mp\", \"model\": \"medium-mpa-0\"}\n",
50-
"# model_params = {\"arch\": \"mace_mp\", \"model\": \"medium-omat-0\"}\n",
51-
"# model_params = {\"arch\": \"chgnet\"}\n",
52-
"# model_params = {\"arch\": \"sevennet\"}"
52+
"# import locale\n",
53+
"# locale.getpreferredencoding = lambda: \"UTF-8\"\n",
54+
"\n",
55+
"# ! pip uninstall torch torchaudio torchvision transformers numpy -y\n",
56+
"# ! uv pip install janus-core[all] data-tutorials torch==2.5.1 --system\n",
57+
"# get_ipython().kernel.do_shutdown(restart=True)"
5358
]
5459
},
5560
{
5661
"cell_type": "markdown",
5762
"metadata": {},
5863
"source": [
59-
"## Set up environment (optional)\n",
60-
"\n",
61-
"These steps are required for Google Colab, but may work on other systems too:"
64+
"You can toggle the following to investigate different models:"
6265
]
6366
},
6467
{
6568
"cell_type": "code",
6669
"execution_count": null,
67-
"metadata": {
68-
"id": "TF-EiWxyuMc7"
69-
},
70+
"metadata": {},
7071
"outputs": [],
7172
"source": [
72-
"# import locale\n",
73-
"# locale.getpreferredencoding = lambda: \"UTF-8\"\n",
74-
"\n",
75-
"# ! pip uninstall torch torchaudio torchvision transformers numpy -y\n",
76-
"# ! uv pip install janus-core[all] data-tutorials torch==2.5.1 --system\n",
77-
"# get_ipython().kernel.do_shutdown(restart=True)"
73+
"model_params = {\"arch\": \"mace_mp\", \"model\": \"medium-0b3\"}\n",
74+
"# model_params = {\"arch\": \"mace_mp\", \"model\": \"medium-mpa-0\"}\n",
75+
"# model_params = {\"arch\": \"mace_mp\", \"model\": \"medium-omat-0\"}\n",
76+
"# model_params = {\"arch\": \"chgnet\"}\n",
77+
"# model_params = {\"arch\": \"sevennet\"}"
7878
]
7979
},
8080
{

0 commit comments

Comments
 (0)