-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
add glossary example as orphan page #4797
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
Can't we keep two glossaries, one for pymc-examples and the other for pymc3 docs? Edit: I see, we only need a PR to pymc3 if a new glossary item is needed? That sounds reasonable |
Yes, I think two glossaries would be confusing and end up being more work. notebooks will be able to link to any term in the glossary without any problem, and users clicking will go to the main pymc3 docs. Side note, in practice I am not sure this will have much of an effect though, we could for example keep the exact same navbar in both docs, so that visually everything looks basically the same, in pymc3 docs, the examples and tutorials would be external links, in pymc-examples the other way around What is not possible (from any of the two) is linking to terms that are not yet defined, so if new notebooks need to add terms to the glossary, they need an extra PR to pymc3 repo (or viceversa, maybe the main docs are more stable and it makes more sense to host the glossary in pymc-examples which is where more new terms will be added 🤔 ) to add the term so that then it can be referenced in the notebook |
Yes I think the pymc3 docs is a better place for the glossary. Edit: I see you actually said the opposite haha :D I will refrain from misreading you again in this PR |
I actually don't know where it would be better! |
Do you want me to push here the terms that will be used in #4783? |
@OriolAbril what shall we do with this PR ? |
Creating a dedicated repository in PyMC just for glossary seems like a good option to me. |
I think we can start trying out the glossary here (thus merge this) and if we see that having a glossary as an independent webpage or having it rendered via pymc-examples works better then move the page. It isn't yet ready to be merged though. I can start fixing some syntax from the distributions dev guide which is so far the only page that has terms so that someone else can then add the definitions. @Sayam753 do we already have PR doc preview for v4? |
Yes, preview - https://pymc3-fork.readthedocs.io/en/latest/ But it is on my fork. I'll roll out a PR later this week, adding support of RTD on main. I guess it will be just a yml file. |
b7132ef
to
f5804e4
Compare
@@ -84,12 +84,12 @@ blah = BlahRV() | |||
|
|||
Some important things to keep in mind: | |||
|
|||
1. Everything inside the `rng_fn` method is pure Python code (as are the inputs) and should not make use of other `Aesara` symbolic ops. The random method should make use of the `rng` which is a Numpy {`class`}`~numpy.random.RandomState`, so that samples are reproducible. | |||
1. Everything inside the `rng_fn` method is pure Python code (as are the inputs) and should not make use of other `Aesara` symbolic ops. The random method should make use of the `rng` which is a Numpy {class}`~numpy.random.RandomState`, so that samples are reproducible. |
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.
just to double check, v4 uses RandomState or Generator?
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.
Both can be used. By default RVs use / create RandomStates
@@ -280,7 +280,7 @@ The latter kind of test (if warranted) can be performed with the aid of `pymc3_r | |||
This kind of test only makes sense if there is a good independent generator reference (i.e., not just the same composition of numpy / scipy python calls that is done inside `rng_fn`). | |||
|
|||
Finally, when your `rng_fn` is doing something more than just calling a `numpy` or `scipy` method, you will need to setup an equivalent seeded function with which to compare for the exact draws (instead of relying on `seeded_[scipy|numpy]_distribution_builder`). | |||
You can find an example in {`class`}`~pymc3.tests.test_distributions_random.TestWeibull`, whose `rng_fn` returns `beta * np.random.weibull(alpha, size=size)`. | |||
You can find an example in {class}`~pymc3.tests.test_distributions_random.TestWeibull`, whose `rng_fn` returns `beta * np.random.weibull(alpha, size=size)`. |
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.
now the syntax for these links is correct, but tests are not part of the documentation, so they don't render as links as their destination doesn't exist.
docs/source/glossary.md
Outdated
Functional Programming | ||
Functional programming is writing pure functions | ||
Dispatching | ||
Choosing which implementation of an operation is used |
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.
@ricardoV94 or anyone else who feels like it, please add the right definitions, relevant links... I have left the two example terms and defintions I added originally to show a bit what is possible.
Codecov Report
@@ Coverage Diff @@
## main #4797 +/- ##
=======================================
Coverage 74.06% 74.06%
=======================================
Files 86 86
Lines 13864 13864
=======================================
Hits 10269 10269
Misses 3595 3595
|
b8461f8
to
e848a21
Compare
Co-authored-by: Ricardo Vieira <[email protected]>
cc @martinacantaro @ricardoV94
Depending on what your PR does, here are a few things you might want to address in the description:
Choosing where within the docs it will be will come later. If we separate building
of examples and docs, I think we should still keep a single glossary in the main docs, we can
then link to term from the notebooks too using intersphinx. The main/only drawback is that
notebooks that need to add new terms to the glossary need an auxiliary PR to pymc3 repo.
intersphinx.
versioned) so that we can then link there from pymc3, arviz, bambi docs... I think @canyon289
has wanted something like that for a long time