-
Notifications
You must be signed in to change notification settings - Fork 6
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 __call__
As Alias For RandomVariable
sample
Method
#253
Add __call__
As Alias For RandomVariable
sample
Method
#253
Conversation
__call__
As Alias For RandomVariable
sample
Method
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #253 +/- ##
==========================================
+ Coverage 92.69% 92.73% +0.03%
==========================================
Files 40 40
Lines 904 908 +4
==========================================
+ Hits 838 842 +4
Misses 66 66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…-method-for-randomvariable-class-that-is-an-alias-for-sample
…-method-for-randomvariable-class-that-is-an-alias-for-sample
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.
Thanks, @AFg6K7h4fhy2! There are some more places where explicit sample()
calls could be replaced with the what you have done in this PR (for example, in the two models). Do you think we should pursue this in this PR or elsewhere?
A silly mistake was made. See DMs. I will cover the rest of these here. |
@AFg6K7h4fhy2 Please review my changes from 903fc2d. If you approve of them (informally), I think this can be merged. |
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 support your changes @damonbayer
This PR is aimed at cleaning up code in tutorials, tests, and elsewhere. The
RandomVariable
class inmetaclass.py
has an abstract sample method. Subclasses ofRandomVariable
typically are sampled. By having an alias for sample in__call__
, MSR users need not continually writeRV.sample()
, as this will be done automatically.