Skip to content

Commit 075a623

Browse files
authored
Update CONTRIBUTING.md
1 parent da89af5 commit 075a623

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

CONTRIBUTING.md

+14-22
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ By making a contribution to this project, I certify that:
2121
### Reporting issues
2222

2323
There are several options:
24-
* Talk to us. You can join our Slack team via this [link](https://opesci-slackin.now.sh/), and join the 'book' channel [here](https://devitocodes.slack.com/archives/C0182SV07NU).
24+
* Talk to us. You can join our Slack team via this [link](https://devitocodes.slack.com/join/shared_invite/zt-gtd2yxj9-Y31YKk_7lr9AwfXeL2iMFg#/), and join the 'book' channel [here](https://devitocodes.slack.com/archives/C0182SV07NU).
2525
* File an issue on [our GitHub page](https://github.com/devitocodes/devito_book/issues).
2626

2727
### Making changes
@@ -30,27 +30,19 @@ First of all, read our [code of conduct](https://github.com/devitocodes/devito_b
3030

3131
The protocol to propose a patch is:
3232
* [Recommended, but not compulsory] Talk to us on Slack about what you're trying to do. There is a great chance we can support you.
33-
* As soon as you know what you need to do, [fork](https://help.github.com/articles/fork-a-repo/) the Devito Book.
34-
* Create a branch with a suitable name.
35-
* Write code following the guidelines below. Commit your changes as small logical units.
36-
* Commit messages should adhere to the format `<tag>: <msg>`, where `<tag>` could be, for example, "wave" (if the commit impacts the waves section of the book), "nonlin", "tests", etc. We may ask you to rebase the commit history if it looks too messy.
37-
* Run the tests for the section you have been working on. Make sure your notebook and the code segments you have been working on compile.
33+
* As soon as you know which notebook you would like to work on, [fork](https://help.github.com/articles/fork-a-repo/) the Devito Book.
34+
* Create a branch with a suitable name - we suggest the format `<github-username>-<notebook-name>`
35+
* Work on your notebook in `fdm-devito-notebooks`. Commit your changes as small logical units.
36+
* Run the tests for the section you have been working on. There are two things to test for each notebook file:
37+
1. **Compilation**: Use `pytest` and the `nbval` plugin to check that each of the code cells in your Jupyter Notebook compiles. Running `py.test --nbval <notebook_name>.ipynb` locally should show you the results of these tests (see [`jupyter-notebooks` workflow](https://github.com/devitocodes/devito_book/blob/master/.github/workflows/jupyter-notebooks.yml))
38+
2. **Verification**: (If applicable) Use `pytest` to run the existing tests in the `.py` files you have been editing and loading functions into the notebook from. Running `py.test -s -v <file_name>.py` locally should show you the results of these tests (see [`verification` workflow](https://github.com/devitocodes/devito_book/blob/master/.github/workflows/verification.yml))
39+
* Add the relevant files you have just tested to the [`jupyter-notebooks`](https://github.com/devitocodes/devito_book/blob/master/.github/workflows/jupyter-notebooks.yml) and [`verification`](https://github.com/devitocodes/devito_book/blob/master/.github/workflows/verification.yml) workflow files on your branch
40+
41+
Skip to **Submitting a Pull Request** if you are not submitting a completed notebook.
42+
* Once all the relevant tests are passing, copy your notebook from `fdm-devito-notebooks` to the relevant chapter in `fdm-jupyter-book/notebooks`, and edit the `_toc.yml` (table of contents) file to include your file. Make sure it's in the right order by checking the readme for that chapter in `fdm-devito-notebooks`
43+
* If your notebook was the last remaining notebook for that chapter of the book, congrats! You can delete the placeholder file for your chapter and remove its reference from `_toc.yml`. Otherwise, just update the placeholder file to no longer reference what you just worked on (since it's now complete). The placeholder files are named as `<chapter-name>_placeholder.md`
44+
45+
#### Submitting a Pull Request
3846
* Push everything to your Devito Book fork.
3947
* Submit a Pull Request on our repository.
4048
* Wait for us to provide feedback.
41-
42-
Tip, especially for newcomers: prefer short, self-contained Pull Requests over lengthy, impenetrable, and thus difficult to review, ones.
43-
44-
### Process for working on a notebook
45-
46-
1. Work on your notebook in `fdm-devito-notebooks`. This contains all of the Jupyter Notebooks (`.ipynb` files) that make up the book. We recommend you run:
47-
48-
```
49-
jupyter notebook fdm-devito-notebooks
50-
```
51-
52-
and navigate to the notebook you are working on in your browser. The [Jupyter Notebook docs](https://jupyter-notebook.readthedocs.io/en/latest/?badge=latest) are a good place to start if you are unfamiliar with Jupyter Notebook.
53-
54-
2. Once you are happy that the notebook has been successfully "Devito-fied", submit a pull request as described above. More information on what constitutes a 'complete' notebook is available in this [readme](https://github.com/devitocodes/devito_book/blob/master/fdm-devito-notebooks/README.md).
55-
56-
NB: A notebook in `fdm-devito-notebooks` only gets copied to `fdm-jupyter-book` once it has been completely Devito-fied and it compiles, since the deployment of the Jupyter Book to GitHub Pages fails if this is not the case.

0 commit comments

Comments
 (0)