-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Remove custom standard RV Op
(s) and add remaining "standard" NumPy RVs
#1461
Conversation
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.
We really need to do something about the existing StandardNormalRV
(i.e. #530), because I believe the new class approach was taken due to its convenience with regard to RandomStream
(i.e. it works with the current RandomStream.__getattr__
implementation). See #528.
In general, we don't want to add new Op
classes if we don't have to, especially in cases like this where the new Op
type implies that its corresponding Apply
nodes will have specific inputs, but there is nothing enforcing this constraint. One reason this approach is problematic: an Apply
using a StandardNormalRV
Op
can be rewritten to have non-zero mean and/or non-unit variance. This implies that StandardNormalRV
is redundant at best, but can also be misleading. (Likewise, adding input constraints to fix this wouldn't help our graph representations in any foreseeable way; if anything, it would unnecessarily complicate things.)
That said, we should first see what can be done about making RandomStream
work with simple definitions like standard_normal = normal(0, 1)
and the partial
functions.
6093a25
to
51b1aad
Compare
Ah, the failure on CI is hard to reproduce on my machine. It says:
But |
This is often due to version mismatches between local environments and CI. I think this issue appeared in another PR as well, so you can add a commit marking it as |
The issue should be fixed in #1464. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1461 +/- ##
==========================================
+ Coverage 74.86% 74.87% +0.01%
==========================================
Files 194 194
Lines 50107 50129 +22
Branches 12098 12097 -1
==========================================
+ Hits 37514 37536 +22
Misses 10266 10266
Partials 2327 2327
|
Op
s and add remaining NumPy entries
Op
s and add remaining NumPy entriesOp
s and add remaining "standard" NumPy RVs
Op
s and add remaining "standard" NumPy RVsOp
(s) and add remaining "standard" NumPy RVs
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 added a fix for the use of partial
functions in RandomStream
and rebased. This should be good to merge once the tests pass.
Fixes #1358
Here are a few important guidelines and requirements to check before your PR can be merged:
pre-commit
is installed and set up.