-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
overhaul gp docstrings #6609
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
overhaul gp docstrings #6609
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6609 +/- ##
==========================================
- Coverage 87.09% 80.78% -6.31%
==========================================
Files 93 94 +1
Lines 15737 15927 +190
==========================================
- Hits 13706 12867 -839
- Misses 2031 3060 +1029
|
Also extended testing.check_icdf with skip_paradomain_outside_edge_test param --------- Co-authored-by: Michal Raczycki <[email protected]>
@OriolAbril would you be willing to help me with this? |
Thanks for taking this on! |
@daniel-saunders-phil
|
…ctive (pymc-devs#6616) * Improved docstring for predictions argument in sample_posterior_predictive * Fix typos Co-authored-by: Ravin Kumar <[email protected]> --------- Co-authored-by: Ravin Kumar <[email protected]>
If an argument is deprecated it should still be in the docs, with a note in the description about being deprecated. It is once it is eventually removed that both argument and itd docstring are deleted For model you should use:
Potential description "Model with the GP component for which predictions will be generated. It is optional when inside a with context, otherwise it is required" |
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.
Quick review from my phone, not sure when I'll have time for a full review
pymc/gp/gp.py
Outdated
The covariance function. Defaults to zero. | ||
mean_func: None, instance of Mean | ||
The mean function. Defaults to zero. | ||
cov_func : 2D array, or instance of Covariance, default Zero |
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.
cov_func : 2D array, or instance of Covariance, default Zero | |
cov_func : 2D array_like or Covariance, default ~pymc.gp.cov.Constant |
Similar comment for mean_func, and I would also switch the order so it matches the order they appear in __init__
pymc/gp/gp.py
Outdated
vector with shape `(n, 1)`. | ||
given : dict, optional | ||
Can take as key value pairs: `X`, `y`, | ||
and `gp`. See the section in the documentation on additive GP |
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.
This can't be a mention, it should be a cross-reference. Anyone knows what page it means?
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.
After digging around for a while, it looks like the only illustration of how additive GPs work is https://www.pymc.io/projects/examples/en/latest/gaussian_processes/GP-MaunaLoa.html
It seems like a gap in the examples/docs and might need to be addressed in future work.
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.
Maybe it's this page still pending update from v3? #5720 cc @bwengals @canyon289
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.
Can we link to unfinished work in a way that the docs will sync up once #5720 is finished or should we leave this be for now?
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.
Yeah it might be, it should point here: https://www.pymc.io/projects/docs/en/v3/Gaussian_Processes.html#additive-gps
pymc/gp/gp.py
Outdated
**kwargs | ||
Extra keyword arguments that are passed to distribution constructor. | ||
Extra keyword arguments that are passed to 'MvStudentT' distribution constructor. |
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.
Extra keyword arguments that are passed to 'MvStudentT' distribution constructor. | |
Extra keyword arguments that are passed to :class:`~pymc.MvStudentT' distribution constructor. |
pymc/gp/gp.py
Outdated
Function input values. If one-dimensional, must be a column | ||
vector with shape `(n, 1)`. | ||
point: pymc.model.Point | ||
point : pymc.model.Point, optional |
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.
point : pymc.model.Point, optional | |
point : pymc.Point, optional |
Hi Oriol, thanks really helpful! I'll do another pass on this in the next couple days and then submit a real PR. |
Okay, I got this pr into a stable shape. It’s ready for review whenever anyone is up for it. the only unresolved bit is the reference to the additive GP example but given that it is still underconstruction, I’ll leave it be. |
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.
Some minor general comments:
-
I prefer using float/int (depending on which is correct) instead of scalar
-
I would also delete the "instance of Class" and leave "Class" only, I think the info conveyed by both is the same.
-
For the reference, I would add a
See the :ref:`section <additive_gp>` in the documentation on additive GP models ...
We can then comment on the issue to make sure that target is added when the doc is updated
Thanks for taking a look. I adjusted those things and sent in a new commit. |
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.
not sure what is going on with the extra modified files, so not merging yet. The docstrings look great already
Oh I see what happened with the extra files: a couple weeks ago I messed up some rebasing command and unwittingly added 4 other people's commits to my own. Do you know the best way to proceed? I could open up a new clean PR with only the finished GP file on it. Or is there a way to delete those commits off my branch? |
You could try to rebase on latest main and If that doesn't work just branch off |
Thanks Michael for the suggestions. I tried both routes and ran into trouble. After chatting with Oriol, we decided the best route was to just create a new branch and new PR #6652. We successfully merge it a little bit ago. I appreciate the help everyone! |
What is this PR about?
#6608 noted some motivation for updating the docs throughout the GP module. Much of the work is just style changes. However a couple of new questions came up as I worked through. I'm marking this as a draft pull request until I can get some input:
is_observed=
argument is used onMarginalKron.marginal_likelihood
and alsoMarginal.marginal_likelihood
. In both cases it is deprecated. But on MarginalKron, there is still a docstring for the argument and on Marginal there isn't. Surely we should standardize but which direction is preferred? I imagine we should eliminate the doc on MarginalKron.model : Model, optional if in with context