Skip to content

Commit 9aa6ca2

Browse files
committed
Merge branch 'main' into structure
2 parents ea6cf32 + e594796 commit 9aa6ca2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+6045
-5229
lines changed

.github/pull_request_template.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!--
2+
Thanks for contributing a pull request to SimPEG user tutorials!
3+
Remember to use a personal fork of SimPEG user tutorials to propose changes.
4+
5+
Check out the stages of a pull request at
6+
https://docs.simpeg.xyz/content/getting_started/contributing/pull-requests.html
7+
8+
Note that we are a team of volunteers and we appreciate your
9+
patience during the review process.
10+
11+
Again, thanks for contributing!
12+
13+
Feel free to remove lines from this template that do not apply to you pull request.
14+
-->
15+
16+
#### Summary
17+
<!-- Add a summary of this Pull Request. Explain what it provides as tutorial material. -->
18+
19+
#### PR Checklist
20+
* [ ] If this is a work in progress PR, set as a Draft PR
21+
* [ ] General
22+
* [ ] Notebook is compatible with latest SimPEG release
23+
* [ ] No deprecated functions and/or input arguments are being used
24+
* [ ] Coding cells linted according to the [style guides](https://docs.simpeg.xyz/latest/content/getting_started/contributing/code-style.html).
25+
* [ ] Introduction is complete:
26+
* [ ] Title and author added to notebook
27+
* [ ] Admonitions for notebook difficulty and computational resources have been added
28+
* [ ] Keywords list has been added
29+
* [ ] Summary paragraph describing the tutorial has been added
30+
* [ ] Learning objectives have been listed
31+
* [ ] Hyperlinks to other tutorial notebooks added if necessary
32+
* [ ] For sections and subsections:
33+
* [ ] A header and short summary of what is being done
34+
* [ ] Links to API documentation added for all classes and functions that are used
35+
* [ ] Newly introduced functionality is explained, or links are provided to relevant materials
36+
* [ ] The approach taken when choosing hyperparameter values is explained. The use of ad hoc values without explanation is discouraged
37+
* [ ] All figures are legible and rendered appropriately
38+
* [ ] Marked as ready for review (if this is was a draft PR), and converted to a pull request
39+
* [ ] Tagged ``@simpeg/simpeg-developers`` when ready for review
40+
41+
42+
#### Additional information
43+
<!--Any additional information you think is important.-->
44+
45+
46+
<!--
47+
Once all tests pass and the code has been reviewed and approved, it will be merged into main
48+
-->

.github/workflows/build.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818

1919
steps:
2020
- name: Checkout repo
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v6
2222

2323
- name: Setup Node
24-
uses: actions/setup-node@v4
24+
uses: actions/setup-node@v6
2525
with:
2626
node-version: '20'
2727

@@ -32,18 +32,25 @@ jobs:
3232
- name: Print MyST version
3333
run: myst --version
3434

35-
- name: Build website as static HTML
35+
- name: Build website as static HTML (for PR)
36+
if: github.event_name == 'pull_request'
37+
run: |
38+
echo "Building MyST website without setting BASE_URL"
39+
myst build --html
40+
41+
- name: Build website as static HTML (for deploy)
42+
if: github.event_name != 'pull_request'
3643
run: |
3744
echo "Building MyST website using BASE_URL=" $BASE_URL
3845
myst build --html
3946
env:
4047
BASE_URL: /${{ github.event.repository.name }}
4148

4249
# Store the website as a build artifact so we can deploy it later
50+
# or preview the website in a PR.
4351
- name: Upload HTML website as an artifact
44-
# Only if not a pull request
45-
if: success() && github.event_name != 'pull_request'
46-
uses: actions/upload-artifact@v4
52+
if: success()
53+
uses: actions/upload-artifact@v6
4754
with:
4855
name: html-${{ github.sha }}
4956
path: _build/html
@@ -59,11 +66,11 @@ jobs:
5966

6067
steps:
6168
- name: Checkout repo
62-
uses: actions/checkout@v4
69+
uses: actions/checkout@v6
6370

6471
# Fetch the built HTML from the build job
6572
- name: Download HTML artifact
66-
uses: actions/download-artifact@v4
73+
uses: actions/download-artifact@v7
6774
with:
6875
name: html-${{ github.sha }}
6976
path: _build/html

.github/workflows/check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717

1818
steps:
1919
- name: Checkout repo
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
2121

2222
- name: Setup Python
23-
uses: actions/setup-python@v5
23+
uses: actions/setup-python@v6
2424
with:
2525
python-version: ${{ env.PYTHON }}
2626

2727
- name: Install required packages
28-
run: pip install ruff nbqa
28+
run: pip install ruff
2929

3030
- name: Check style of notebooks
3131
run: make check

Makefile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
NOTEBOOKS_DIR=notebooks
22

3-
.PHONY: build run clean check format
3+
.PHONY: build run clean check check-style check-format format
44

55
help:
66
@echo "Commands:"
77
@echo ""
8-
@echo " build build Myst website (without running notebooks)"
9-
@echo " clean clean output of Myst website"
10-
@echo " run run all notebooks"
11-
@echo " check lint notebooks with nbqa and ruff"
12-
@echo " format autoformat notebooks with nbqa and ruff"
8+
@echo " build build Myst website (without running notebooks)"
9+
@echo " clean clean output of Myst website"
10+
@echo " run run all notebooks"
11+
@echo " check check notebooks style and format with ruff"
12+
@echo " check-style check notebooks style with ruff"
13+
@echo " check-format check notebooks format with ruff"
14+
@echo " format autoformat notebooks with ruff"
1315
@echo ""
1416

1517

1618
build:
17-
msyt build --html
19+
myst build --html
1820

1921
clean:
20-
msyt clean --all
22+
myst clean --all
2123

2224
run:
2325
jupyter nbconvert --to notebook --execute --inplace "${NOTEBOOKS_DIR}/**/*.ipynb"
2426

25-
check:
26-
nbqa ruff "${NOTEBOOKS_DIR}"
27+
check: check-format check-style
28+
29+
check-style:
30+
ruff check "${NOTEBOOKS_DIR}"
31+
32+
check-format:
33+
ruff format --check "${NOTEBOOKS_DIR}"
2734

2835
format:
29-
nbqa ruff --fix "${NOTEBOOKS_DIR}"
36+
ruff format "${NOTEBOOKS_DIR}"

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ preview it. Follow the instructions that will be prompted by the command to see
5151
the website:
5252

5353
```bash
54-
msyt start
54+
myst start
5555
```
5656

5757
#### Build only
@@ -60,7 +60,7 @@ The following command will build the website and store the HTML files in
6060
a new `_build` folder:
6161

6262
```bash
63-
msyt build --html
63+
myst build --html
6464
```
6565

6666
#### Clean cached builds
@@ -115,24 +115,31 @@ jupyter nbconvert --to notebook --execute --inplace notebooks/**/*.ipynb
115115

116116
## Check style of notebooks
117117

118-
We can check the code style of our notebooks using [`ruff`][ruff] and
119-
[`nbqa`][nbqa]. Simply run the following command to check the style of the
120-
notebooks:
118+
We can check the code style of our notebooks using [`ruff`][ruff].
119+
Simply run the following command to check the style of the notebooks:
121120

122121
```bash
123-
nbqa ruff notebooks
122+
ruff check notebooks
123+
```
124+
125+
You can run the following that the notebooks are correctly formatted:
126+
127+
```bash
128+
ruff format --check notebooks
124129
```
125130

126131
And run this to autoformat them:
127132

128133
```bash
129-
nbqa ruff --fix notebooks
134+
ruff format --fix notebooks
130135
```
131136

132137
Alternatively, you can use the targets we have in the `Makefile`, like `make
133138
check` and `make format`. Read more information about the available targets
134139
by running `make help`.
135140

141+
[ruff]: https://astral.sh/ruff
142+
136143
## License
137144

138145
All text and figures are licensed under a
15.6 KB
Binary file not shown.
15.6 KB
Binary file not shown.

environment.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@ name: simpeg-user-tutorials
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.10.*
5+
- python=3.13.*
66
# Myst requirements
77
- nodejs>18
88
- mystmd
99
# Notebook requirements
1010
- jupyter
1111
- jupyterlab-myst
1212
- nbconvert
13-
- simpeg==0.23.*
14-
- discretize==0.11.*
13+
- simpeg==0.25.*
14+
- discretize==0.12.*
1515
- choclo==0.3.*
16-
- scikit-learn
16+
- scikit-learn==1.7.*
1717
- pymatsolver
18-
# Code quality
19-
- nbqa
18+
# Code style
2019
- ruff

index.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SimPEG user tutorials is the place for those who have [installed SimPEG](https:/
1010

1111

1212
:::{caution} Caution
13-
These user tutorials are meant to be run with **SimPEG v0.23**.
13+
These user tutorials are meant to be run with **SimPEG v0.25**.
1414
Please, make sure you have this version installed.
1515
:::
1616

@@ -106,3 +106,10 @@ Requires moderate computational resources. Run-times may exceed several minutes
106106
The computational resources required to execute this notebook exceed those provided by standard laptop computers. To execute the notebook, please deploy to a cluster computing environment.
107107
```
108108

109+
Want to Add a Tutorial?
110+
-----------------------
111+
112+
Please visit the [Contributing to User Tutorials](notebooks/contributing_index.md) page to find out how you can add a tutorial.
113+
114+
115+

myst.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ project:
1717
- name: Devin Cowan
1818
id: devincowan
1919
affiliations: ubc
20+
orcid: 0000-0002-0089-402X
2021
roles:
2122
- writing
2223
- editing
@@ -115,6 +116,11 @@ project:
115116
children:
116117
- file: notebooks/pgi/plot_inv_1_joint_pf_pgi_full_info_tutorial.ipynb
117118
- file: notebooks/pgi/plot_inv_2_joint_pf_pgi_no_info_tutorial.ipynb
119+
- file: notebooks/contributing_index.md
120+
children:
121+
- file: notebooks/contributing/build_website.md
122+
- file: notebooks/contributing/formatting.md
123+
- file: notebooks/contributing/pull_request.md
118124

119125
site:
120126
template: book-theme

0 commit comments

Comments
 (0)