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

Expand dimensionality notebook #5746

Merged

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented May 5, 2022

I thought it would be useful to expand the dimensionality notebook. It might be a bit too long detailed right now, but I is is probably is easier to discuss from more -> less than the other way around.

I also feel it is better to separate the ellipsis into it's own section and that is not yet finished!

Apologies for tagging so many people for review, but this seems to be a critical part of our documentation that can benefit from varied inputs

Rendered at: https://pymc--5746.org.readthedocs.build/en/5746/learn/core_notebooks/dimensionality.html

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ricardoV94 ricardoV94 force-pushed the dimensionality_notebook_improvement branch from 27b87ad to c025340 Compare May 5, 2022 16:45
@ricardoV94 ricardoV94 marked this pull request as draft May 5, 2022 16:45
@ricardoV94 ricardoV94 force-pushed the dimensionality_notebook_improvement branch 2 times, most recently from 0b82f29 to ad20354 Compare May 5, 2022 16:59
@twiecki
Copy link
Member

twiecki commented May 6, 2022

Please don't force-push as it confuses reviewnb.

@ricardoV94
Copy link
Member Author

Please don't force-push as it confuses reviewnb.

ReviewNB seems useless in this case anyway. I suggest checking the rendered docs directly: https://pymc--5746.org.readthedocs.build/en/5746/learn/core_notebooks/dimensionality.html

@twiecki
Copy link
Member

twiecki commented May 6, 2022 via email

@ricardoV94
Copy link
Member Author

ricardoV94 commented May 6, 2022

It's nice for review though.

You can't see the graphviz outputs. But what did force-push screw up?

@twiecki
Copy link
Member

twiecki commented May 6, 2022

You can't see the graphviz outputs. But what did force-push screw up?

It didn't allow me to post the comments so I had to copy&paste them over.

@OriolAbril
Copy link
Member

To the danger of becoming a broken record, I think we should define the intended audience of this notebook so that we are all on the same page and can make meaningful reviews.

For example,

I would also mention that this document is more for advanced users. Most users should be fine with just knowing how dims work and use that as best practice. Ideally we'd have a separate beginner tutorial just on that.

I thought the idea was originally to make a beginner level doc, not really sure now, but I do agree there seems to be a tension here. IMO the scope is quite ambitious and more fitting of advanced level notebook, but the style is more beginner like. i.e. beginners probably don't need to care about all 3 shape, size and dims, 2 at most, and at the same time advanced users don't need to be taught to use size/dims instead of list comprehensions of variables

@@ -9,28 +9,29 @@
},
Copy link
Contributor

Choose a reason for hiding this comment

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

We could also mention the difference at the logp level


Reply via ReviewNB

Copy link
Member Author

Choose a reason for hiding this comment

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

I would not do it here

@@ -9,28 +9,29 @@
},
Copy link
Contributor

Choose a reason for hiding this comment

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

One thing that we didn't mention is what coords are used in arviz when the model only defines the dimension name and lets the explicit or implicit size/shape determine the final shape of the RV.


Reply via ReviewNB

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's fine to omit that detail from here, as this is not so concerned with the InferenceData machinery

@canyon289
Copy link
Member

canyon289 commented May 19, 2022

@ricardoV94 do you need a review from me before the discussion in #5754 is settled or are you good? Want to make sure youre supported :)

@ricardoV94
Copy link
Member Author

@ricardoV94 do you need a review from me before the discussion in #5754 is settled or are you good? Want to make sure youre supported :)

Good for now! Thanks :D

@ricardoV94 ricardoV94 force-pushed the dimensionality_notebook_improvement branch from ad20354 to 8333a1e Compare June 14, 2022 09:46
@ricardoV94 ricardoV94 marked this pull request as ready for review June 14, 2022 09:46
@ricardoV94
Copy link
Member Author

Ready for re-review. I have addressed several comments and removed size explanations for now.

@ricardoV94 ricardoV94 force-pushed the dimensionality_notebook_improvement branch from 8333a1e to c55967e Compare June 14, 2022 09:50
@ricardoV94
Copy link
Member Author

I started but it looked like several comments were not addressed (like typos).

Yeah I forgot to go over the typos, will push again in a sec

@ricardoV94 ricardoV94 force-pushed the dimensionality_notebook_improvement branch 2 times, most recently from fdc78ab to 0e21bb7 Compare June 14, 2022 10:44
@ricardoV94
Copy link
Member Author

ricardoV94 commented Jun 14, 2022

Okay, I cleaned and force-pushed for the last time for a while. Check the second commit in ReviewNB to see the differences between now and the original PR commit

@ricardoV94
Copy link
Member Author

ricardoV94 commented Jun 14, 2022

Regarding black, the only sensible thing is to add it to the pre-commit. Why haven't we done so already?

@ricardoV94
Copy link
Member Author

ReadTheDocs is erroring out with

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/pymc/conda/5746/lib/python3.8/site-packages/jupyter_client/kernelspec.py", line 294, in get_kernel_spec
    raise NoSuchKernel(kernel_name)
jupyter_client.kernelspec.NoSuchKernel: No such kernel named pymc

@michaelosthege
Copy link
Member

@ricardoV94 check the source of the *.ipynb at the JSON level. These notebooks sometimes (ß?!) save which kernel they were executed with.

@ricardoV94
Copy link
Member Author

@ricardoV94 check the source of the *.ipynb at the JSON level. These notebooks sometimes (ß?!) save which kernel they were executed with.

Yeah probably something like that

@@ -9,231 +9,1402 @@
},
Copy link
Member

Choose a reason for hiding this comment

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

This is all heading.


Reply via ReviewNB

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I am not sure why...

Copy link
Member

Choose a reason for hiding this comment

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

Don't you use a ## thing?

Copy link
Member

@OriolAbril OriolAbril Jun 21, 2022

Choose a reason for hiding this comment

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

@@ -9,231 +9,1402 @@
},
Copy link
Member

Choose a reason for hiding this comment

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

Are coords not explicit?


Reply via ReviewNB

Copy link
Member Author

Choose a reason for hiding this comment

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

Coords are explicit, but when you define a distribution you used dims. Or what did you mean?

@@ -9,231 +9,1402 @@
},
Copy link
Member

Choose a reason for hiding this comment

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

Theres all these new words introduced like implcit dimensions, or parameter core dimensions, but theyre not listed at the top. I think its good if they were so its clear what is going to be explained throughout this doc, and provides an easy reference. If they can be linked to the heading in this notebook thatd be even better


Reply via ReviewNB

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that all the important terms are mentioned in the beginning, and this text clearly states we need to introduce a new concept (core dimensions), just to understand this example. I don't think this concept is as critical to be listed at the top.

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.

RE rtd failure: we need to do a couple updates to conf.py

https://github.com/ricardoV94/pymc/blob/0e21bb7e928aeab01e8a875ae46616a0650f3beb/docs/source/conf.py#L147-L154

Should be updated to:

# myst config
nb_execution_mode = "force"
nb_kernel_rgx_aliases = {".*": "python3"}
myst_enable_extensions = ["colon_fence", "deflist", "dollarmath", "amsmath", "substitution"]
myst_substitutions = {
    "version_slug": rtd_version,
}
myst_heading_anchors = None

The failure is due to the nb_kernel... one. By default, sphinx executes each notebook with the kernel name listed in the ipynb file which is pymc here, not python3 like the other notebooks. Adding this overrides the kernel provided by the notebook and executes all notebooks with the python3 kernel (the only one we have installed on readthedocs). The other changes are updating/removing deprecated parameters.

@ricardoV94 ricardoV94 force-pushed the dimensionality_notebook_improvement branch 2 times, most recently from c0eed0d to 3748814 Compare June 17, 2022 15:52
@ricardoV94
Copy link
Member Author

Ready for re-review

@ricardoV94 ricardoV94 force-pushed the dimensionality_notebook_improvement branch 2 times, most recently from 474aa67 to c6d97c1 Compare June 17, 2022 16:15
@OriolAbril
Copy link
Member

The text in all admonitions ends with :::: https://pymcio--5746.org.readthedocs.build/projects/docs/en/5746/learn/core_notebooks/dimensionality.html. Not sure why, but probably related to breaklines. I see the last command removes the ending colon fence which might end up in strange rendering issues at some point.

In admonitions, the text can start in the same line as the opening of the directive, but the closing fence must always be on a different line. The line in which the content is written defines how sphinx interprets that content, see https://sphinx-primer.readthedocs.io/en/latest/core/directives.html

@ricardoV94
Copy link
Member Author

ns, the text can start in the same line as the opening of the directive, but the closing fence must always be on a different line. The line in which the content is written defines how

Fixed it

Other changes:
* Seed draws
* Give more succinct tittle to last section
* Fix directives
@ricardoV94 ricardoV94 force-pushed the dimensionality_notebook_improvement branch from c6d97c1 to d34dff1 Compare June 17, 2022 16:46
@twiecki twiecki merged commit 0cdd229 into pymc-devs:main Jun 21, 2022
@ricardoV94 ricardoV94 deleted the dimensionality_notebook_improvement branch June 6, 2023 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants