Skip to content

Commit b9c829a

Browse files
authored
extending guidance on watermark in jupyter style guide (#6051)
* adding markdown cell for Watermark * clean up watermark section * show Markdown cell right above code cell * remove flags explanation * solving precommit error * clean up watermark section * last code cell
1 parent 52f8673 commit b9c829a

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

docs/source/contributing/jupyter_style.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -488,19 +488,24 @@ extra_bibtex_id_2
488488
```
489489

490490
## Watermark
491-
Once you're finished with your NB, add a very last cell with [the watermark package](https://github.com/rasbt/watermark). This will automatically print the versions of Python and the packages you used to run the NB -- reproducibility rocks! Here is some example code. Note that the `-p` argument may not be necessary (or it may need to have different libraries as input), but all the other arguments must be present.
491+
492+
[`watermark`](https://github.com/rasbt/watermark) is a library which automatically prints the versions of Python and the packages you used to run the NB -- reproducibility rocks!
493+
494+
This library should be in your virtual environment if you installed our `requirements-dev.txt`. Otherwise, run `pip install watermark`.
495+
496+
First, add a Markdown cell with the `## Watermark` title only so it appears in the table of contents. This is the second to last section, above the epilogue/footer. Then, add a code cell to print the versions of Python and packages used in the notebook. This is the last *code* cell in the notebook.
497+
498+
The `p` flag is optional (or it may need to have different libraries as input), but should be added if Aesara or xarray are not imported explicitly. This will also be checked by `pre-commit` (because we all forget to do things sometimes 😳).
499+
500+
```markdown
501+
## Watermark
502+
```
492503

493504
```python
494505
%load_ext watermark
495506
%watermark -n -u -v -iv -w -p aesara,aeppl,xarray
496507
```
497508

498-
This second to last code cell should be preceded by a markdown cell with the `## Watermark` title only so it appears in the table of contents.
499-
500-
`watermark` should be in your virtual environment if you installed our `requirements-dev.txt`.
501-
Otherwise, just run `pip install watermark`.
502-
The `p` flag is optional but should be added if Aesara or xarray are not imported explicitly.
503-
This will also be checked by `pre-commit` (because we all forget to do things sometimes 😳).
504509

505510
## Epilogue
506511
The last cell in the notebooks should be a markdown cell with exactly the following content:
@@ -515,5 +520,4 @@ update the path to page footer for the include to work.
515520

516521
---
517522

518-
You're all set now 🎉 You can push your changes, open a pull request, and, once it's merged, rest with the feeling of a job well done 👏
519-
Thanks a lot for your contribution to open-source, we really appreciate it!
523+
You're all set now 🎉. You can push your changes, open a pull request, and, once it's merged, rest with the feeling of a job well done 👏. Thanks a lot for your contribution to open-source, we really appreciate it!

0 commit comments

Comments
 (0)