-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pull request template #50
base: main
Are you sure you want to change the base?
Changes from 5 commits
dae4eed
153ab74
6b84e76
d08ad00
eed4dc8
db64727
18fda61
7762b25
794f7aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,44 @@ | ||||||
<!-- | ||||||
Thanks for contributing a pull request to SimPEG user tutorials! | ||||||
Remember to use a personal fork of SimPEG user tutorials to propose changes. | ||||||
|
||||||
Check out the stages of a pull request at | ||||||
https://docs.simpeg.xyz/content/getting_started/contributing/pull-requests.html | ||||||
|
||||||
Note that we are a team of volunteers and we appreciate your | ||||||
patience during the review process. | ||||||
|
||||||
Again, thanks for contributing! | ||||||
|
||||||
Feel free to remove lines from this template that do not apply to you pull request. | ||||||
--> | ||||||
|
||||||
#### Summary | ||||||
<!-- Add a summary of this Pull Request. Explain what it provides as tutorial material. --> | ||||||
|
||||||
#### PR Checklist | ||||||
* [ ] If this is a work in progress PR, set as a Draft PR | ||||||
* [ ] Introduction is complete: | ||||||
* [ ] Title and author added to notebook | ||||||
* [ ] Admonitions for notebook difficulty and computational resources have been added | ||||||
* [ ] Keywords list has been added | ||||||
* [ ] Summary paragraph describing the tutorial has been added | ||||||
* [ ] Learning objectives have been listed | ||||||
* [ ] Hyperlinks to other tutorial notebooks added if necessary | ||||||
* [ ] For sections and subsections: | ||||||
* [ ] A header and short summary of what is being done | ||||||
* [ ] Links to API documentation added for all classes and functions that are used | ||||||
* [ ] Newly introduced functionality is explained or links provided to relevant notebooks | ||||||
* [ ] All figures are legible and rendered appropriately | ||||||
* [ ] Coding cells have been linted according to the [style guides](https://docs.simpeg.xyz/latest/content/getting_started/contributing/code-style.html). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have style guide for this particular repo. I'd suggest linking at those instead of linking to the ones we have in SimPEG.
Suggested change
|
||||||
* [ ] Marked as ready for review (if this is was a draft PR), and converted to a pull request | ||||||
* [ ] Tagged ``@simpeg/simpeg-developers`` when ready for review. | ||||||
|
||||||
|
||||||
#### Additional information | ||||||
<!--Any additional information you think is important.--> | ||||||
|
||||||
|
||||||
<!-- | ||||||
Once all tests pass and the code has been reviewed and approved, it will be merged into main | ||||||
--> |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,109 @@ | ||||||
Building the User Tutorials Website Locally | ||||||
=========================================== | ||||||
|
||||||
Here, we provide instructions for setting up an appropriate Python environment and building the SimPEG user tutorials website locally with [MyST](https://mystmd.org/). | ||||||
|
||||||
## Step 1: Cloning the GitHub Repository | ||||||
|
||||||
The URL for the SimPEG user tutorials GitHub repository is: https://github.com/simpeg/user-tutorials/. If using the Git Bash shell: | ||||||
|
||||||
```bash | ||||||
git clone https://github.com/simpeg/user-tutorials | ||||||
cd user-tutorials | ||||||
``` | ||||||
|
||||||
## Step 2: Setting Up a Python Environment | ||||||
|
||||||
The Jupyter notebooks containing the tutorials are maintained to run properly using the [latest release of SimPEG](https://github.com/simpeg/simpeg/releases). | ||||||
Notebooks may not run correctly if SimPEG is being imported from an earlier release or development branch. | ||||||
The [mystmd][install-mystmd] and [nodejs](https://nodejs.org/api/packages.html) are also required to build the website locally. | ||||||
|
||||||
We advise building a Python environment from the `environment.yml` file in the root directory of the repository. | ||||||
To create the `simpeg-user-tutorials` environment using conda: | ||||||
|
||||||
```bash | ||||||
conda env create -f environment.yml | ||||||
``` | ||||||
|
||||||
Once built, you can activate using: | ||||||
|
||||||
```bash | ||||||
conda activate simpeg-user-tutorials | ||||||
``` | ||||||
|
||||||
## Step 3: Build and Execution Commands | ||||||
|
||||||
The SimPEG user tutorials are a collection of [Jupyter Notebook](https://jupyter.org/) (and [Markdown](https://www.markdownguide.org/getting-started/)) files, | ||||||
which [MyST][mystmd.org] builds into a website. Here, we describe the commands that contributors should be familiar with. | ||||||
|
||||||
:::{important} | ||||||
The tutorial notebooks, including their states, are tracked by GitHub. When the SimPEG user tutorials repository was cloned, all notebooks had been run and saved. Therefore, you do not need to rerun all of the notebooks prior to building the website! | ||||||
::: | ||||||
|
||||||
### Locally Build and Serve Website | ||||||
|
||||||
The following command will build the website and serve it locally. | ||||||
This will allow you to preview the website and observe any changes to notebooks on the fly. | ||||||
To locally build and serve the website: | ||||||
the website: | ||||||
|
||||||
```bash | ||||||
msyt start | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo:
Suggested change
|
||||||
``` | ||||||
|
||||||
Next, follow the instructions prompted by the command to launch the local build in your brower. | ||||||
|
||||||
### Build Only | ||||||
|
||||||
The following command will build the website and store the HTML files in | ||||||
a new `_build` folder: | ||||||
|
||||||
```bash | ||||||
msyt build --html | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo:
Suggested change
|
||||||
``` | ||||||
|
||||||
### Clean Cached Builds | ||||||
|
||||||
```bash | ||||||
myst clean --all | ||||||
``` | ||||||
|
||||||
### Rerunning Notebooks | ||||||
|
||||||
When making alterations and rerunning notebooks, we typically do so by launching Jupyter Notebooks: | ||||||
|
||||||
```bash | ||||||
jupyter notebook | ||||||
``` | ||||||
|
||||||
However, we can rerun a notebook and overwrite its output cells in place using `nbconvert`. | ||||||
To rerun a single notebook, use: | ||||||
|
||||||
```bash | ||||||
jupyter nbconvert --to notebook --execute --inplace notebook.ipynb | ||||||
``` | ||||||
|
||||||
We may also want to rerun all notebooks in the repository. | ||||||
To rerun all notebooks, use: | ||||||
|
||||||
```bash | ||||||
jupyter nbconvert --to notebook --execute --inplace notebooks/**/*.ipynb | ||||||
``` | ||||||
|
||||||
:::{danger} | ||||||
Rerunning all notebooks is a computationally intensive task. Some notebooks | ||||||
require significant amount of memory to allocate large sensitivity matrices. | ||||||
::: | ||||||
|
||||||
> [!IMPORTANT] | ||||||
> If you are using bash as your shell, make sure to run `shopt -s | ||||||
> globstar` to enable the `globstar` feature that allows the use of `**` for | ||||||
> filename expansion. | ||||||
|
||||||
|
||||||
|
||||||
|
||||||
[install-mystmd]: https://mystmd.org/guide/quickstart | ||||||
[jupyter]: https://jupyter.org | ||||||
[mystmd.org]: https://mystmd.org | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about simplifying the text in these items? Something like this: