-
Notifications
You must be signed in to change notification settings - Fork 2.1k
adding markdown cell for Watermark #6051
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
Conversation
@OriolAbril I missed this in the divergence notebook PR: and the other PRs I have worked on. |
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.
I updated the instructions to include an explicit markdown cell.
Thanks
## Watermark | ||
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. | ||
|
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.
I think the text should also be updated otherwise it doesn't really match anymore. How about something like this?
## Watermark | |
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. | |
## Watermark | |
Once you're finished with your NB, add a a final code cell with [the watermark package](https://github.com/rasbt/watermark) preceded by a markdown cell with the section title: | |
Then move the
This will automatically print the versions of Python and the packages you used to run the NB -- reproducibility rocks!
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.
part after the code cell and remove the
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.
@OriolAbril
|
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.
Thanks!
We should probably also add a page "About pymc-examples" in the "In-depth explanations" section with all the background on why we do each of the things, the mysy-ipynb duplication, the pre-commit checks (like forbidding internal links or links to other pyhton docs to be urls)... but it is hard to find time for this
|
||
This library should be in your virtual environment if you installed our `requirements-dev.txt`. Otherwise, run `pip install watermark`. | ||
|
||
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. |
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.
I find the "second to last section" description confusing. On the raw notebook, this is the last section/heading, the page_footer thing is only a markdown cell without heading. On the rendered docs, the page_footer is substituted by some content and it adds 2 headings, so in the page toc that appears on the website the Watermark is generally the 3rd to last heading.
I also would not mind if the watermark/references/author sections are swapped but yes, ideally they would appear in the order listed here in the style guide.
There is one piece of info that needs to be added though. IMO, what is key here is that the watermark is the last code cell in the notebook which is no longer mentioned.
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.
@OriolAbril
I added in "last code cell".
For my personal notebooks coding, I add the watermark cell at the top, after my imports so I can see in the beginning exactly what versions of the library I am using or need to use.
I am not sure why we need to specify "last code cell", though it's easy enough to add, and I added that in.
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.
That is something that should be documented in that "about pymc examples" page as we did discuss it during GSoD and agreed on putting it at the end like authors, references and citation advise.
The example notebooks are first and foremost documentation for pymc. Each of them has some authors and has potentially been adapted from a blog post even, but they are now part of the documentation. We believe it is important to recognize the specific authors but it is also information that has no relevance as documentation to a user trying to do model averaging.
The examples are also under a different versioning scheme than the rest of the documentation. That means that whatever version you are reading the API docs of, when you click on example gallery or on a text link that points to a notebook you will always get to latest
slug. Notebooks will most commonly not be executed with the version you are using but they will still be valid and useful documentation; execptuating major versions, the API doesn't change that fast. Theferore, the fact that a notebook runs on 4.0.2 does not mean that the notebook is not valid to you because you use 4.1.4 (otherwise 95% of the docs would be permanently useless). The watermark is relevant only when things don't work to see which are the versions that work, try a different snapshot to see if it has been executed with a version closer to yours and that code works... and so we decided to put it at the bottom to avoid having it distract from the actual content.
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.
approving but not merging yet as I am not sure what is going on with readthedocs
Is this related to the ads, or another issue with readthedocs? |
I was worried about the failing readthedocs check. I didn't think it was related to the adds though, now from slack discussions it looks like an obscure jax issue. both the readthedocs and the jax CI job have been failing since the last release so I will merge but as the job is failing, the website won't update until we fix that |
Add an explicit markdown cell for "Watermark".
This is for the Jupyter Style Guide.
#DataUmbrellaPyMCSprint