Skip to content

Commit 8413811

Browse files
committed
Update Colab setup instructions
1 parent 9bb3c84 commit 8413811

File tree

11 files changed

+432
-51
lines changed

11 files changed

+432
-51
lines changed

docs/source/tutorials/cli/geomopt.ipynb

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@
2525
"source": [
2626
"## Set up environment (optional)\n",
2727
"\n",
28-
"These steps are required for Google Colab, but may work on other systems too:"
28+
"These steps are required to run this tutorial with Google Colab. To do so, uncomment and run the cell below.\n",
29+
"\n",
30+
"This will replace pre-installed versions of `numpy` and `torch` in Colab with versions that are known to be compatible with `janus-core`.\n",
31+
"\n",
32+
"It may be possible to skip the steps that uninstall and reinstall `torch`, which will save a considerable amount of time.\n",
33+
"\n",
34+
"These instructions but may work for other systems too, but it is typically preferable to prepare a virtual environment separately before running this notebook if possible."
2935
]
3036
},
3137
{
@@ -39,9 +45,32 @@
3945
"# import locale\n",
4046
"# locale.getpreferredencoding = lambda: \"UTF-8\"\n",
4147
"\n",
42-
"# ! pip uninstall torch torchaudio torchvision transformers numpy -y\n",
43-
"# ! uv pip install janus-core[all] data-tutorials torch==2.5.1 --system\n",
44-
"# get_ipython().kernel.do_shutdown(restart=True)"
48+
"# ! pip uninstall numpy -y # Uninstall pre-installed numpy\n",
49+
"\n",
50+
"# ! pip uninstall torch torchaudio torchvision transformers -y # Uninstall pre-installed torch\n",
51+
"# ! uv pip install torch==2.5.1 # Install pinned version of torch\n",
52+
"\n",
53+
"# ! uv pip install janus-core[mace,sevennet,visualise] data-tutorials --system # Install janus-core with MACE, SevenNet, and WeasWidget, and data-tutorials\n",
54+
"\n",
55+
"# get_ipython().kernel.do_shutdown(restart=True) # Restart kernel to update libraries. This may warn that your session has crashed."
56+
]
57+
},
58+
{
59+
"cell_type": "markdown",
60+
"metadata": {},
61+
"source": [
62+
"To ensure you have the latest version of `janus-core` installed, compare the output of the following cell to the latest version available at https://pypi.org/project/janus-core/"
63+
]
64+
},
65+
{
66+
"cell_type": "code",
67+
"execution_count": null,
68+
"metadata": {},
69+
"outputs": [],
70+
"source": [
71+
"from janus_core import __version__\n",
72+
"\n",
73+
"print(__version__)"
4574
]
4675
},
4776
{

docs/source/tutorials/cli/md.ipynb

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@
2525
"source": [
2626
"## Set up environment (optional)\n",
2727
"\n",
28-
"These steps are required for Google Colab, but may work on other systems too:"
28+
"These steps are required to run this tutorial with Google Colab. To do so, uncomment and run the cell below.\n",
29+
"\n",
30+
"This will replace pre-installed versions of `numpy` and `torch` in Colab with versions that are known to be compatible with `janus-core`.\n",
31+
"\n",
32+
"It may be possible to skip the steps that uninstall and reinstall `torch`, which will save a considerable amount of time.\n",
33+
"\n",
34+
"These instructions but may work for other systems too, but it is typically preferable to prepare a virtual environment separately before running this notebook if possible."
2935
]
3036
},
3137
{
@@ -39,9 +45,39 @@
3945
"# import locale\n",
4046
"# locale.getpreferredencoding = lambda: \"UTF-8\"\n",
4147
"\n",
42-
"# ! pip uninstall torch torchaudio torchvision transformers numpy -y\n",
43-
"# ! uv pip install janus-core[all] data-tutorials torch==2.5.1 --system\n",
44-
"# get_ipython().kernel.do_shutdown(restart=True)"
48+
"# ! pip uninstall numpy -y # Uninstall pre-installed numpy\n",
49+
"\n",
50+
"# ! pip uninstall torch torchaudio torchvision transformers -y # Uninstall pre-installed torch\n",
51+
"# ! uv pip install torch==2.5.1 # Install pinned version of torch\n",
52+
"\n",
53+
"# ! uv pip install janus-core[mace,visualise] data-tutorials --system # Install janus-core with MACE and WeasWidget, and data-tutorials\n",
54+
"\n",
55+
"# get_ipython().kernel.do_shutdown(restart=True) # Restart kernel to update libraries. This may warn that your session has crashed."
56+
]
57+
},
58+
{
59+
"cell_type": "markdown",
60+
"metadata": {},
61+
"source": [
62+
"To ensure you have the latest version of `janus-core` installed, compare the output of the following cell to the latest version available at https://pypi.org/project/janus-core/"
63+
]
64+
},
65+
{
66+
"cell_type": "code",
67+
"execution_count": null,
68+
"metadata": {},
69+
"outputs": [],
70+
"source": [
71+
"from janus_core import __version__\n",
72+
"\n",
73+
"print(__version__)"
74+
]
75+
},
76+
{
77+
"cell_type": "markdown",
78+
"metadata": {},
79+
"source": [
80+
"## Prepare data and modules"
4581
]
4682
},
4783
{
@@ -50,13 +86,13 @@
5086
"metadata": {},
5187
"outputs": [],
5288
"source": [
53-
"# from data_tutorials.data import get_data\n",
89+
"from data_tutorials.data import get_data\n",
5490
"\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-
"# )"
91+
"get_data(\n",
92+
" url=\"https://raw.githubusercontent.com/stfc/janus-core/main/docs/source/tutorials/data/\",\n",
93+
" filename=[\"NaCl-1040.extxyz\"],\n",
94+
" folder=\"../data\",\n",
95+
")"
6096
]
6197
},
6298
{

docs/source/tutorials/cli/neb.ipynb

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@
4545
"source": [
4646
"## Set up environment (optional)\n",
4747
"\n",
48-
"These steps are required for Google Colab, but may work on other systems too:"
48+
"These steps are required to run this tutorial with Google Colab. To do so, uncomment and run the cell below.\n",
49+
"\n",
50+
"This will replace pre-installed versions of `numpy` and `torch` in Colab with versions that are known to be compatible with `janus-core`.\n",
51+
"\n",
52+
"It may be possible to skip the steps that uninstall and reinstall `torch`, which will save a considerable amount of time.\n",
53+
"\n",
54+
"These instructions but may work for other systems too, but it is typically preferable to prepare a virtual environment separately before running this notebook if possible."
4955
]
5056
},
5157
{
@@ -59,9 +65,39 @@
5965
"# import locale\n",
6066
"# locale.getpreferredencoding = lambda: \"UTF-8\"\n",
6167
"\n",
62-
"# ! pip uninstall torch torchaudio torchvision transformers numpy -y\n",
63-
"# ! uv pip install janus-core[all] data-tutorials torch==2.5.1 --system\n",
64-
"# get_ipython().kernel.do_shutdown(restart=True)"
68+
"# ! pip uninstall numpy -y # Uninstall pre-installed numpy\n",
69+
"\n",
70+
"# ! pip uninstall torch torchaudio torchvision transformers -y # Uninstall pre-installed torch\n",
71+
"# ! uv pip install torch==2.5.1 # Install pinned version of torch\n",
72+
"\n",
73+
"# ! uv pip install janus-core[mace,visualise] data-tutorials --system # Install janus-core with MACE and WeasWidget, and data-tutorials\n",
74+
"\n",
75+
"# get_ipython().kernel.do_shutdown(restart=True) # Restart kernel to update libraries. This may warn that your session has crashed."
76+
]
77+
},
78+
{
79+
"cell_type": "markdown",
80+
"metadata": {},
81+
"source": [
82+
"To ensure you have the latest version of `janus-core` installed, compare the output of the following cell to the latest version available at https://pypi.org/project/janus-core/"
83+
]
84+
},
85+
{
86+
"cell_type": "code",
87+
"execution_count": null,
88+
"metadata": {},
89+
"outputs": [],
90+
"source": [
91+
"from janus_core import __version__\n",
92+
"\n",
93+
"print(__version__)"
94+
]
95+
},
96+
{
97+
"cell_type": "markdown",
98+
"metadata": {},
99+
"source": [
100+
"## Prepare data"
65101
]
66102
},
67103
{

docs/source/tutorials/cli/phonons.ipynb

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@
3232
"source": [
3333
"## Set up environment (optional)\n",
3434
"\n",
35-
"These steps are required for Google Colab, but may work on other systems too:"
35+
"These steps are required to run this tutorial with Google Colab. To do so, uncomment and run the cell below.\n",
36+
"\n",
37+
"This will replace pre-installed versions of `numpy` and `torch` in Colab with versions that are known to be compatible with `janus-core`.\n",
38+
"\n",
39+
"It may be possible to skip the steps that uninstall and reinstall `torch`, which will save a considerable amount of time.\n",
40+
"\n",
41+
"These instructions but may work for other systems too, but it is typically preferable to prepare a virtual environment separately before running this notebook if possible."
3642
]
3743
},
3844
{
@@ -46,9 +52,39 @@
4652
"# import locale\n",
4753
"# locale.getpreferredencoding = lambda: \"UTF-8\"\n",
4854
"\n",
49-
"# ! pip uninstall torch torchaudio torchvision transformers numpy -y\n",
50-
"# ! uv pip install janus-core[all] data-tutorials torch==2.5.1 --system\n",
51-
"# get_ipython().kernel.do_shutdown(restart=True)"
55+
"# ! pip uninstall numpy -y # Uninstall pre-installed numpy\n",
56+
"\n",
57+
"# ! pip uninstall torch torchaudio torchvision transformers -y # Uninstall pre-installed torch\n",
58+
"# ! uv pip install torch==2.5.1 # Install pinned version of torch\n",
59+
"\n",
60+
"# ! uv pip install janus-core[mace,visualise] data-tutorials --system # Install janus-core with MACE and WeasWidget, and data-tutorials\n",
61+
"\n",
62+
"# get_ipython().kernel.do_shutdown(restart=True) # Restart kernel to update libraries. This may warn that your session has crashed."
63+
]
64+
},
65+
{
66+
"cell_type": "markdown",
67+
"metadata": {},
68+
"source": [
69+
"To ensure you have the latest version of `janus-core` installed, compare the output of the following cell to the latest version available at https://pypi.org/project/janus-core/"
70+
]
71+
},
72+
{
73+
"cell_type": "code",
74+
"execution_count": null,
75+
"metadata": {},
76+
"outputs": [],
77+
"source": [
78+
"from janus_core import __version__\n",
79+
"\n",
80+
"print(__version__)"
81+
]
82+
},
83+
{
84+
"cell_type": "markdown",
85+
"metadata": {},
86+
"source": [
87+
"## Prepare data"
5288
]
5389
},
5490
{

docs/source/tutorials/cli/singlepoint.ipynb

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@
3434
"source": [
3535
"## Set up environment (optional)\n",
3636
"\n",
37-
"These steps are required for Google Colab, but may work on other systems too:"
37+
"These steps are required to run this tutorial with Google Colab. To do so, uncomment and run the cell below.\n",
38+
"\n",
39+
"This will replace pre-installed versions of `numpy` and `torch` in Colab with versions that are known to be compatible with `janus-core`.\n",
40+
"\n",
41+
"It may be possible to skip the steps that uninstall and reinstall `torch`, which will save a considerable amount of time.\n",
42+
"\n",
43+
"These instructions but may work for other systems too, but it is typically preferable to prepare a virtual environment separately before running this notebook if possible."
3844
]
3945
},
4046
{
@@ -48,9 +54,39 @@
4854
"# import locale\n",
4955
"# locale.getpreferredencoding = lambda: \"UTF-8\"\n",
5056
"\n",
51-
"# ! pip uninstall torch torchaudio torchvision transformers numpy -y\n",
52-
"# ! uv pip install janus-core[all] data-tutorials torch==2.5.1 --system\n",
53-
"# get_ipython().kernel.do_shutdown(restart=True)"
57+
"# ! pip uninstall numpy -y # Uninstall pre-installed numpy\n",
58+
"\n",
59+
"# ! pip uninstall torch torchaudio torchvision transformers -y # Uninstall pre-installed torch\n",
60+
"# ! uv pip install torch==2.5.1 # Install pinned version of torch\n",
61+
"\n",
62+
"# ! uv pip install janus-core[mace,sevennet,visualise] data-tutorials --system # Install janus-core with MACE, SevenNet, and WeasWidget, and data-tutorials\n",
63+
"\n",
64+
"# get_ipython().kernel.do_shutdown(restart=True) # Restart kernel to update libraries. This may warn that your session has crashed."
65+
]
66+
},
67+
{
68+
"cell_type": "markdown",
69+
"metadata": {},
70+
"source": [
71+
"To ensure you have the latest version of `janus-core` installed, compare the output of the following cell to the latest version available at https://pypi.org/project/janus-core/"
72+
]
73+
},
74+
{
75+
"cell_type": "code",
76+
"execution_count": null,
77+
"metadata": {},
78+
"outputs": [],
79+
"source": [
80+
"from janus_core import __version__\n",
81+
"\n",
82+
"print(__version__)"
83+
]
84+
},
85+
{
86+
"cell_type": "markdown",
87+
"metadata": {},
88+
"source": [
89+
"## Prepare data"
5490
]
5591
},
5692
{

docs/source/tutorials/python/eos.ipynb

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@
2525
"source": [
2626
"## Set up environment (optional)\n",
2727
"\n",
28-
"These steps are required for Google Colab, but may work on other systems too:"
28+
"These steps are required to run this tutorial with Google Colab. To do so, uncomment and run the cell below.\n",
29+
"\n",
30+
"This will replace pre-installed versions of `numpy` and `torch` in Colab with versions that are known to be compatible with `janus-core`.\n",
31+
"\n",
32+
"It may be possible to skip the steps that uninstall and reinstall `torch`, which will save a considerable amount of time.\n",
33+
"\n",
34+
"These instructions but may work for other systems too, but it is typically preferable to prepare a virtual environment separately before running this notebook if possible."
2935
]
3036
},
3137
{
@@ -39,9 +45,39 @@
3945
"# import locale\n",
4046
"# locale.getpreferredencoding = lambda: \"UTF-8\"\n",
4147
"\n",
42-
"# ! pip uninstall torch torchaudio torchvision transformers numpy -y\n",
43-
"# ! uv pip install janus-core[all] data-tutorials torch==2.5.1 --system\n",
44-
"# get_ipython().kernel.do_shutdown(restart=True)"
48+
"# ! pip uninstall numpy -y # Uninstall pre-installed numpy\n",
49+
"\n",
50+
"# ! pip uninstall torch torchaudio torchvision transformers -y # Uninstall pre-installed torch\n",
51+
"# ! uv pip install torch==2.5.1 # Install pinned version of torch\n",
52+
"\n",
53+
"# ! uv pip install janus-core[mace,sevennet,chgnet,visualise] data-tutorials --system # Install janus-core with MACE, SevenNet, CHGNet, and WeasWidget, and data-tutorials\n",
54+
"\n",
55+
"# get_ipython().kernel.do_shutdown(restart=True) # Restart kernel to update libraries. This may warn that your session has crashed."
56+
]
57+
},
58+
{
59+
"cell_type": "markdown",
60+
"metadata": {},
61+
"source": [
62+
"To ensure you have the latest version of `janus-core` installed, compare the output of the following cell to the latest version available at https://pypi.org/project/janus-core/"
63+
]
64+
},
65+
{
66+
"cell_type": "code",
67+
"execution_count": null,
68+
"metadata": {},
69+
"outputs": [],
70+
"source": [
71+
"from janus_core import __version__\n",
72+
"\n",
73+
"print(__version__)"
74+
]
75+
},
76+
{
77+
"cell_type": "markdown",
78+
"metadata": {},
79+
"source": [
80+
"## Prepare data and modules"
4581
]
4682
},
4783
{

0 commit comments

Comments
 (0)