|
1 | 1 | # openmm-cookbook |
2 | | -Proof-of-concept for the OpenMM Cookbook. |
| 2 | + |
| 3 | +This repo is home to the OpenMM Cookbook and the OpenMM Tutorials |
3 | 4 |
|
4 | 5 | Preview at https://openmm.github.io/openmm-cookbook |
5 | 6 |
|
6 | 7 | ## Adding a notebook |
7 | 8 |
|
8 | | -A notebooks can be added to the cookbook by adding it to a subfolder of the `notebooks` folder. Links to download the notebook, view it in GitHub, or open it in Google Colab are added to the rendered notebook on the website automatically. Any files required by the notebook should be placed in the same folder as the notebook --- they are required by both the testing apparatus and Google Colab. The notebook must also be added to `index.md`. |
| 9 | +To add a new cookbook add the ipynb notebook to the `notebooks/cookbook` folder and add a link to it in `cookbook.md`. To add a new tutorial add the ipynb notebook to the `notebooks/tutorials` folder and add a link to it in `tutorials.md` |
| 10 | + |
| 11 | +Links to download the notebook, view it in GitHub, or open it in Google Colab are added to the rendered notebook on the website automatically. Any files required by the notebook should be placed in the same folder as the notebook --- they are required by both the testing apparatus and Google Colab. The notebook must also be added to `index.md`. |
9 | 12 |
|
10 | 13 | "Open in Google Colab" links to a copy of the notebook that is constructed when the documentation is built. This copy has a cell injected that allows the notebook's dependencies to be installed automatically. By default, each notebook will install the Conda Forge packages specified in the `cookbook_default_conda_forge_deps` variable in `conf.py`, and then download all the files in the notebook's folder into the notebook's execution environment. This can be configured on a per-notebook basis by adding the `conda_forge_dependencies` or `required_files` metadata entries to the notebook. |
11 | 14 |
|
12 | | -Notebook thumbnails can be configured in several ways, as described in the [nbsphinx documentation]. |
| 15 | +Notebook thumbnails can be configured in several ways, as described in the [nbsphinx documentation](https://nbsphinx.readthedocs.io/). |
| 16 | + |
| 17 | + |
| 18 | +## Building locally |
| 19 | + |
| 20 | +First clone this repo, then create a conda environment using [environment.yml](environment.yml). |
| 21 | +The cookbook can then be built using |
| 22 | +``` |
| 23 | +make html |
| 24 | +``` |
| 25 | +the created html will be in the `build/html` directory and can be viewed by opening `build/html/index.html` in a browser. |
13 | 26 |
|
14 | 27 | ## Releases |
15 | 28 |
|
16 | | -The cookbook's `main` branch is intended for use with the latest release of OpenMM. When new cookbooks are added, they will be served immediately and tested against the current release. Nightly tests are performed against OpenMM's development branch, and any fixes required will live in feature branches or a `next` branch. When a new release of OpenMM is cut, the state of `main`, which reflects an entire release cycle, is memorialized with a release tag and rendered to gh-pages in its own release folder. Any feature branches or `next` branches are then merged in so that `main` is now compatible with the new release. |
| 29 | +The cookbooks main branch is the development channel, it is rendered as `https://openmm.github.io/openmm-cookbook/dev/`, anytime the main branch is updated the rendered cookbook will be updated. |
| 30 | + |
| 31 | +When a release is cut the current working state of the cookbook will be preserved as `https://openmm.github.io/openmm-cookbook/refs/tags/${release}/index.html` where `${release}` is the release tag. e.g. `https://openmm.github.io/openmm-cookbook/refs/tags/v0.1/index.html`. |
| 32 | + |
| 33 | + |
| 34 | + The latest version of the cookbook will point to the most recent release `https://openmm.github.io/openmm-cookbook/latest/` |
| 35 | + |
| 36 | +## CI |
| 37 | + |
| 38 | +Continuous integration is run on the main branch of the cookbook. Just the notebooks in `notebooks/cookbook` are run through the CI, tutorials are not (due to long compute time). There are two workflows: [Main](.github/workflows/ci-main.yml) will test that the notebooks run with the latest release of OpenMM, [Nightly](.github/workflows/ci-nightly.yml) will test that the notebooks run with the development version of OpenMM. |
| 39 | + |
| 40 | +## Pull Requests |
| 41 | + |
| 42 | +When a PR is triggered the cookbook will be rendered as `https://openmm.github.io/openmm-cookbook/PR#/` where PR# is the pull request number e.g. [PR16](https://openmm.github.io/openmm-cookbook/PR16/index.html). **Note** that due to github actions permissions the *Deploy to GitHub Pages* step in the [gh-pages workflow](.github/workflows/gh-pages.yml) will only work correctly if the PR comes from a branch *within* `https://github.com/openmm/openmm-cookbook` and it will not work when the PR comes from a personal fork. |
| 43 | + |
| 44 | + |
17 | 45 |
|
18 | | -This strategy allows cookbooks for the current version to be released instantly while still permitting testing of notebooks in CI, and preserving the state of the cookbook at each release for posterity. |
19 | 46 |
|
20 | | -[nbsphinx documentation]: https://nbsphinx.readthedocs.io/en/0.8.7/subdir/gallery.html |
|
0 commit comments