Skip to content

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

Merged
merged 4 commits into from
Aug 28, 2021
Merged

add glossary example as orphan page #4797

merged 4 commits into from
Aug 28, 2021

Conversation

OriolAbril
Copy link
Member

cc @martinacantaro @ricardoV94

Depending on what your PR does, here are a few things you might want to address in the description:

  • important background, or details about the implementation
    • Creates a glossary page so that we can already start adding terms and definitions there.
      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.
    • We could also do that the other way around, glossary in pymc-examples, link from pymc3 docs with
      intersphinx.
    • Another somewhat too ambitious alternative would be to host a Bayesian glossary (single web, non
      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
  • linting/style checks have been run

@ricardoV94
Copy link
Member

ricardoV94 commented Jun 21, 2021

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

@OriolAbril
Copy link
Member Author

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

@ricardoV94
Copy link
Member

ricardoV94 commented Jun 21, 2021

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

@OriolAbril
Copy link
Member Author

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!

@ricardoV94
Copy link
Member

Do you want me to push here the terms that will be used in #4783?

@michaelosthege
Copy link
Member

@OriolAbril what shall we do with this PR ?

@Sayam753
Copy link
Member

Another somewhat too ambitious alternative would be to host a Bayesian glossary (single web, non
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

Creating a dedicated repository in PyMC just for glossary seems like a good option to me.
And then we can decide either adding it as a submodule or just linking it from the documentation.

@OriolAbril
Copy link
Member Author

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?

@Sayam753
Copy link
Member

@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.

@@ -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.
Copy link
Member Author

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?

Copy link
Member

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)`.
Copy link
Member Author

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.

Comment on lines 15 to 18
Functional Programming
Functional programming is writing pure functions
Dispatching
Choosing which implementation of an operation is used
Copy link
Member Author

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.

@OriolAbril OriolAbril requested a review from ricardoV94 July 29, 2021 11:57
@codecov
Copy link

codecov bot commented Jul 29, 2021

Codecov Report

Merging #4797 (4c9ebf7) into main (ea263f6) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4797   +/-   ##
=======================================
  Coverage   74.06%   74.06%           
=======================================
  Files          86       86           
  Lines       13864    13864           
=======================================
  Hits        10269    10269           
  Misses       3595     3595           
Impacted Files Coverage Δ
pymc3/parallel_sampling.py 86.28% <0.00%> (-1.01%) ⬇️
pymc3/backends/report.py 91.60% <0.00%> (+2.09%) ⬆️

@OriolAbril OriolAbril mentioned this pull request Aug 2, 2021
@OriolAbril OriolAbril merged commit 529a317 into main Aug 28, 2021
@OriolAbril OriolAbril deleted the init_glossary branch August 28, 2021 08:52
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.

4 participants