-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add gufunc signature to RandomVariable
's docstrings
#1160
Conversation
RandomVariable
\'s docstringsRandomVariable
's docstrings
This work is part of #695. We need to create a single, consistent interface for this information and apply it to all the (effectively) block-wise |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1160 +/- ##
==========================================
+ Coverage 79.14% 79.35% +0.21%
==========================================
Files 173 161 -12
Lines 48528 48282 -246
Branches 10322 10962 +640
==========================================
- Hits 38408 38316 -92
+ Misses 7628 7454 -174
- Partials 2492 2512 +20
|
Regardless of how we implement the interface we need to communicate how the current shape systems works to the users in the documentation, and I think gufunc signatures are the right tool for that. |
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 think those two were wrong
They were! |
ac3e073
to
0dd1d51
Compare
Squashed the commits. |
8fd15a0
to
63410a7
Compare
Should we merge this? This documents the current behavior of |
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.
Given how many of these are scalars and, as a result, have trivial signatures, it's hard to say how useful those particular cases are.
Regardless, it doesn't hurt to add them, but we need to do something about the gufunc
/RandomVariable
comment before that.
63410a7
to
5b0a4bb
Compare
5b0a4bb
to
52f5402
Compare
Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com>
52f5402
to
4b3af51
Compare
In this PR I add gufunc signatures to the
RandomVariable
s docstrings. The notation is clear and concise; with knoweldge of broadcasting rules and the definition ofsize
the signature makes shapes predictible.Most distributions behave like
Elemwise
Op
s, with the exception of:(), (n) -> (n)
(k) -> (k)
(n), (n,n) -> (n)
(p) -> ()
(x) -> ()
(x) -> (x)