Skip to content
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

Update stochastic volatility notebook for best practices #378

Merged
merged 5 commits into from
Jul 28, 2022

Conversation

ckrapu
Copy link
Contributor

@ckrapu ckrapu commented Jun 18, 2022

This PR updates the stochastic volatility example notebook to include some recommended updates from the style guide and addresses #60

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ckrapu
Copy link
Contributor Author

ckrapu commented Jun 18, 2022

I had trouble finding out who was the original author of this notebook since it's been around for awhile - any ideas?

@ckrapu ckrapu changed the title Bring stochastic volatility notebook in line with style guide Update stochastic volatility notebook for best practices Jun 18, 2022
Fixing dashes in reference entry

Removing extra lines from reference bib file
@ckrapu ckrapu force-pushed the update-stochastic-volatility branch from 7580644 to 7a0f349 Compare June 18, 2022 02:45
@twiecki
Copy link
Member

twiecki commented Jun 18, 2022

Author is me if I remember correctly.

@twiecki
Copy link
Member

twiecki commented Jun 18, 2022

I think you need to remove and recreate the myst file.

Copy link
Member

@OriolAbril OriolAbril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I left some comments regarding style and use of sphinx features

I have reviewed on the myst because I find it much easier and comfortable, but I'd recommend making the changes on the notebook and letting jupytext update the myst one.

---

(notebook_name)=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, that was a big oversight.

myst_nbs/case_studies/stochastic_volatility.myst.md Outdated Show resolved Hide resolved
myst_nbs/case_studies/stochastic_volatility.myst.md Outdated Show resolved Hide resolved
:::{post} June 17, 2022
:tags: time series
:category: basic
:author: Thomas Wiecki
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everyone who appears on the authorship section (except those that have only re-executed the notebook) should appear here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This brings up an interesting issue because there is extensive history on this notebook stretching back to its .py incarnation, with multiple people making multiple edits over time. I've got a new author list at the Authors section at the end of this notebook - does that format look acceptable?

For more recent edits, I've tried to explicitly point out the PR while for those that edited multiple times, I was less specific.

1. Hoffman & Gelman. (2011). [The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo](http://arxiv.org/abs/1111.4246).
:::{bibliography}
:filter: docname in docnames
:::

```{code-cell} ipython3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a markdown cell with the "watermark" title before this code cell: https://docs.pymc.io/en/latest/contributing/jupyter_style.html#watermark


+++

* Written by Thomas Wiecki in 2013
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notebook seems to have been created in pymc-devs/pymc@f76a6b1 from the already existing pyhton script with that example. The python script looks like it was introduced in pymc-devs/pymc@2fe6e88

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking down the history! Did you find it just by going to an older version of pymc and then looking at the history from there? Or is there a trick to viewing the file history back to 2013 on GitHub from within the pymc-examples?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went to pymc repo and searched "stochastic volatility" on the PR tab, opened the oldest one and clicked on "browse files" or something like that which brought me to the right notebook already around 2013, then checked the history of that file to find the first commit I linked. From there I checked the history of the python script to find the 2nd commit I linked. I hope that makes sense, seeing it written sounds super complicated but it took longer to write this down than it took to do the actual thing 😅

@OriolAbril OriolAbril merged commit a9e4656 into pymc-devs:main Jul 28, 2022
kuvychko pushed a commit to kuvychko/pymc-examples that referenced this pull request Oct 20, 2022
* Bring stochastic volatility notebook in line with style guide

Fixing dashes in reference entry

Removing extra lines from reference bib file

* Adding original author information to stochastic volatility notebook

* Adding updated myst file

* Fixing misspecified tags and updating author list

* Update stochastic_volatility.myst.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants