-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Doc change the default value of pymc.draw from 500 to 1. #5543
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
Codecov Report
@@ Coverage Diff @@
## main #5543 +/- ##
==========================================
+ Coverage 87.24% 87.26% +0.02%
==========================================
Files 81 81
Lines 14244 14244
==========================================
+ Hits 12427 12430 +3
+ Misses 1817 1814 -3
|
do you want to update the rest of the docstring following #5459? Both yes or no are fine, they just influence the scope of the review |
Yes @OriolAbril, I'm happy to update the remainder of the docstring, but I'm not sure how to set the proper type for |
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.
the return section also needs some updates following https://pymc-data-umbrella.xyz/en/latest/sprint/docstring_tutorial.html#returns-and-yields (or what is the same https://numpydoc.readthedocs.io/en/latest/format.html#returns)
pymc/sampling.py
Outdated
@@ -2128,7 +2128,7 @@ def draw( | |||
vars |
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.
vars | |
vars : tensor_like or iterable of tensor_like |
vars is missing the type but it is required, so it should have no optional nor default after the type.
pymc/sampling.py
Outdated
@@ -2128,7 +2128,7 @@ def draw( | |||
vars | |||
A variable or a list of variables for which to draw samples. | |||
draws : int |
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.
draws : int | |
draws : int, default 1 |
draws is optional, so it should have either optional or default. As here the default is of the documented type and a specific value, using default instead of optional is preferred, as explained in the third point of https://pymc-data-umbrella.xyz/en/latest/sprint/docstring_tutorial.html#parameters. The default would then be removed from the description below
pymc/sampling.py
Outdated
@@ -2128,7 +2128,7 @@ def draw( | |||
vars | |||
A variable or a list of variables for which to draw samples. | |||
draws : int | |||
Number of samples needed to draw. Detaults to 500. | |||
Number of samples needed to draw. Detaults to 1. | |||
mode |
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 is missing the type and the , optional
pymc/sampling.py
Outdated
@@ -2128,7 +2128,7 @@ def draw( | |||
vars | |||
A variable or a list of variables for which to draw samples. | |||
draws : int | |||
Number of samples needed to draw. Detaults to 500. | |||
Number of samples needed to draw. Detaults to 1. | |||
mode | |||
The mode used by ``aesara.function`` to compile the graph. | |||
**kwargs |
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.
**kwargs | |
**kwargs : dict, 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.
Thank you, I will follow the same : )
pymc/sampling.py
Outdated
Returns | ||
------- | ||
List[np.ndarray] | ||
out : list of ndarrays | ||
A list of numpy arrays. |
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.
I'm not sure if this return statement is correct; please have a look.
pymc/sampling.py
Outdated
@@ -2125,18 +2125,18 @@ def draw( | |||
|
|||
Parameters | |||
---------- | |||
vars | |||
vars : tensor_like or iterable of tensor_like |
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.
I made a mistake here before, tensor_like includes things that can be converted to aesara tensorvariable like lists or numpy arrays, that is not the case here.
vars : tensor_like or iterable of tensor_like | |
vars : Variable or iterable of Variable |
pymc/sampling.py
Outdated
**kwargs | ||
draws : int, default 1 | ||
Number of samples needed to draw. | ||
mode : str or `Mode` instance, 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.
there should be no backticks in type descriptions. I am not sure if Mode
is a common input type, if it is, this should be Mode
without backticks nor instance and we'll add a numpydoc alias. If it is not, it should be aesara.compile.mode.Mode
again no backticks nor instance.
pymc/sampling.py
Outdated
Keyword arguments for :func:`pymc.aesara.compile_pymc` | ||
|
||
Returns | ||
------- | ||
List[np.ndarray] | ||
out : list of ndarrays |
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.
out : list of ndarrays | |
list of ndarray |
types should always be used in singular version, and in numpydoc, if there is only one output it should not be named, only the type info should be present.
pymc/sampling.py
Outdated
draws : int, default 1 | ||
Number of samples needed to draw. | ||
mode : str or `Mode` instance, optional | ||
The mode used by :func:``aesara.function`` to compile the graph. |
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.
The mode used by :func:``aesara.function`` to compile the graph. | |
The mode used by :func:`aesara.function` to compile the graph. |
Thank you very much, @OriolAbril; I'm learning a lot from you 😊😃 |
Closes #5542
Changed the default value of draws from 500 to 1.