-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Refactor Multivariate RandomWalk distributions #6131
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
5cfd8ff
to
c0e6776
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6131 +/- ##
===========================================
+ Coverage 81.62% 93.58% +11.96%
===========================================
Files 101 101
Lines 22093 22151 +58
===========================================
+ Hits 18034 20731 +2697
+ Misses 4059 1420 -2639
|
c0e6776
to
f1ab46b
Compare
5d52bd2
to
bf2cdcc
Compare
bf2cdcc
to
dd0de56
Compare
dd0de56
to
06f76c6
Compare
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.
Great PR @ricardoV94, as always!
It seems like get_dists
does a lot of the hard work for the dist
method, but why couldn't it be a part of RandomWalk
? I am guessing that the answer is inherent to metaclasses but I just can't pinpoint it right now.
): | ||
raise TypeError("init_dist must be a univariate distribution variable") | ||
raise TypeError("init_dist must be a distribution variable") | ||
check_dist_not_registered(init_dist) | ||
|
||
if not ( |
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 this check be a helper function? I feel like we often check these conditions
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 I always think about it. It's on the edge of being so short that it doesn't make complete sense. Have to think about it
@classmethod | ||
@abc.abstractmethod | ||
def get_dists(cls, *args, **kwargs): | ||
pass |
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.
raise NotImplementedError
here maybe?
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.
abc.abstractmethod does 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.
ooo
2787c57
to
e3a919c
Compare
* Do not call `at.stack` until the end * Allow to pass single shape_offset
Also create abstract class for predefined RandomWalks
e3a919c
to
b134701
Compare
Related to #4642
Checklist
Major / Breaking Changes
Bugfixes / New features
RandomWalk
to multivariate casesDocs / Maintenance
MvGaussianRandomWalk
andMvStudentTRandomWalk
for V4