Skip to content

Commit 2a447fe

Browse files
committed
add tutorials to doc attempt2
1 parent 5d30a76 commit 2a447fe

File tree

7 files changed

+60
-30
lines changed

7 files changed

+60
-30
lines changed

.github/workflows/docs.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ jobs:
3636
pip install .[strict,docs]
3737
3838
- name: Copy tutorials
39-
run: cp -r tutorials docs/
39+
run: |
40+
cp -r tutorials docs/
41+
jupyter nbconvert --to markdown docs/tutorials/*.ipynb
42+
jupyter nbconvert --to markdown docs/tutorials/*/*.ipynb
4043
4144
- name: Build
4245
run: sphinx-build docs docs_build

docs/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ user/docs-schemas-emmet
99
user/fireworks
1010
user/atomate-1-vs-2
1111
user/codes/index
12+
tutorials/tutorials
1213
```
1314

1415
```{toctree}

tutorials/force_fields/phonon_workflow.ipynb

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
22
"cells": [
33
{
4+
"metadata": {},
45
"cell_type": "markdown",
5-
"id": "0",
6+
"source": "# Phonon Workflow Tutorial with Force Fields",
7+
"id": "86e9d7e2e155339d"
8+
},
9+
{
610
"metadata": {},
7-
"source": [
8-
"We start with imports necessary to test the tutorial automatically. In practice, you can load a structure file from any other place and you are also not required to generate the data in a temporary directory."
9-
]
11+
"cell_type": "markdown",
12+
"source": "We start with imports necessary to test the tutorial automatically. In practice, you can load a structure file from any other place and you are also not required to generate the data in a temporary directory.",
13+
"id": "0"
1014
},
1115
{
1216
"cell_type": "code",

tutorials/openmm_tutorial.ipynb

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
{
22
"cells": [
33
{
4+
"metadata": {},
45
"cell_type": "markdown",
5-
"id": "0",
6+
"source": "# OpenMM Tutorial",
7+
"id": "ace71c1812743076"
8+
},
9+
{
610
"metadata": {
711
"jupyter": {
812
"outputs_hidden": false
913
}
1014
},
15+
"cell_type": "markdown",
1116
"source": [
12-
"### Installing Atomate2 From Source with OpenMM\n",
17+
"## Installing Atomate2 From Source with OpenMM\n",
1318
"\n",
1419
"```bash\n",
1520
"# setting up our conda environment\n",
@@ -46,14 +51,15 @@
4651
"pip uninstall bson\n",
4752
"pip install pymongo\n",
4853
"```"
49-
]
54+
],
55+
"id": "0"
5056
},
5157
{
5258
"cell_type": "markdown",
5359
"id": "1",
5460
"metadata": {},
5561
"source": [
56-
"### Understanding Atomate2 OpenMM \n",
62+
"## Understanding Atomate2 OpenMM\n",
5763
"\n",
5864
"Atomate2 is really just a collection of jobflow workflows relevant to materials science. In all the workflows, we pass our system of interest between different jobs to perform the desired simulation. Representing the intermediate state of a classical molecular dynamics simulation, however, is challenging. While the intermediate representation between stages of a periodic DFT simulation can include just the elements, xyz coordinates, and box vectors, classical molecular dynamics systems must also include velocities and forces. The latter is particularly challenging because all MD engines represent forces differently. Rather than implement our own representation, we use the `openff.interchange.Interchange` object, which catalogs the necessary system properties and interfaces with a variety of MD engines. This is the object that we pass between stages of a classical MD simulation and it is the starting point of our workflow."
5965
]
@@ -63,7 +69,7 @@
6369
"id": "2",
6470
"metadata": {},
6571
"source": [
66-
"### Pouring a Glass of Wine\n",
72+
"## Pouring a Glass of Wine\n",
6773
"\n",
6874
"The first job we need to create generates the `Interchange` object. To specify the system of interest, we use give it the SMILES strings, counts, and names (optional) of the molecules we want to include."
6975
]
@@ -173,7 +179,7 @@
173179
"id": "8",
174180
"metadata": {},
175181
"source": [
176-
"### The basic simulation\n",
182+
"## The basic simulation\n",
177183
"\n",
178184
"To run a production simulation, we will create a production flow, link it to our `elyte_interchange_job`, and then run both locally.\n",
179185
"\n",
@@ -245,7 +251,7 @@
245251
"id": "11",
246252
"metadata": {},
247253
"source": [
248-
"### Configuring the Simulation\n",
254+
"## Configuring the Simulation\n",
249255
"\n",
250256
"All OpenMM jobs, i.e. anything in `atomate2.openmm.jobs`, inherits from the `BaseOpenMMMaker` class. `BaseOpenMMMaker` is highly configurable, you can change the timestep, temperature, reporting frequencies, output types, and a range of other properties. See the docstring for the full list of options.\n",
251257
"\n",
@@ -277,7 +283,7 @@
277283
"id": "14",
278284
"metadata": {},
279285
"source": [
280-
"### Running with Databases\n",
286+
"## Running with Databases\n",
281287
"\n",
282288
"Before trying this, you should have a basic understanding of JobFlow and [Stores](https://materialsproject.github.io/jobflow/stores.html).\n",
283289
"\n",
@@ -366,7 +372,7 @@
366372
"id": "15",
367373
"metadata": {},
368374
"source": [
369-
"### Running on GPU(s)\n",
375+
"## Running on GPU(s)\n",
370376
"\n",
371377
"Running on a GPU is nearly as simple as running on a CPU. The only difference is that you need to specify the `platform_properties` argument in the `EnergyMinimizationMaker` with the `DeviceIndex` of the GPU you want to use."
372378
]

tutorials/phonon_workflow.ipynb

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
"cell_type": "markdown",
3131
"id": "2",
3232
"metadata": {},
33-
"source": [
34-
"# Phonon Workflow"
35-
]
33+
"source": "# Phonon Workflow Tutorial with VASP"
3634
},
3735
{
3836
"cell_type": "markdown",

tutorials/qha_workflow.ipynb

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
22
"cells": [
33
{
4+
"metadata": {},
45
"cell_type": "markdown",
5-
"id": "0",
6+
"source": "# Quasi-harmonic Workflow Tutorial with VASP",
7+
"id": "b2ab3e6e84f7233b"
8+
},
9+
{
610
"metadata": {},
7-
"source": [
8-
"This first part is only needed as we have to mock VASP here as we cannot run it directly in a jupyter notebook:"
9-
]
11+
"cell_type": "markdown",
12+
"source": "This first part is only needed as we have to mock VASP here as we cannot run it directly in a jupyter notebook:",
13+
"id": "0"
1014
},
1115
{
1216
"cell_type": "code",
@@ -51,14 +55,6 @@
5155
"}"
5256
]
5357
},
54-
{
55-
"cell_type": "markdown",
56-
"id": "2",
57-
"metadata": {},
58-
"source": [
59-
"QHA workflow"
60-
]
61-
},
6258
{
6359
"cell_type": "markdown",
6460
"id": "3",
@@ -263,6 +259,12 @@
263259
" )"
264260
]
265261
},
262+
{
263+
"metadata": {},
264+
"cell_type": "markdown",
265+
"source": "## Let's retrieve the data and analyze it",
266+
"id": "2dc7b73048bebabf"
267+
},
266268
{
267269
"cell_type": "code",
268270
"execution_count": null,
@@ -307,7 +309,7 @@
307309
" strict=False,\n",
308310
"):\n",
309311
" # Create the plot\n",
310-
" plt.plot(result[\"output\"][\"volumes\"], energy_list, marker=\"o\")\n",
312+
" plt.plot(result[\"output\"][\"volumes\"], energy_list, marker=\"o\", label=temp)\n",
311313
" # Add labels and title\n",
312314
"plt.xlabel(\"Volume\")\n",
313315
"plt.ylabel(\"Free Energy\")\n",

tutorials/tutorials.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(tutorials)=
2+
3+
# Tutorials
4+
5+
The section includes tutorials for workflows in atomate2.
6+
They can also be found in the form of jupyternotebooks in:
7+
[https://github.com/materialsproject/atomate2/tree/main/tutorials](https://github.com/materialsproject/atomate2/tree/main/tutorials)
8+
9+
```{toctree}
10+
blob_storage
11+
lobster_workflow
12+
openmm_tutorial
13+
phonon_workflow
14+
qha_workflow
15+
force_fields/phonon_workflow
16+
```

0 commit comments

Comments
 (0)