-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Convert stats and diagnostics to new API #232
Conversation
c1293c7
to
59038f9
Compare
I think this is now ready to go. There's some missing documentation, but also this will allow us to delete most of |
arviz/stats/stats.py
Outdated
raise ValueError('The number of observations should be the same ' | ||
'across all models') | ||
raise ValueError( | ||
"The number of observations should be the same " "across all models" |
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.
Being picky, redundant parentheses here?
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.
Fixed - I actually ran black
on the file as an experiment - this might have been part of the result.
59038f9
to
0f6ccd4
Compare
LGTM |
|
||
|
||
__all__ = ['effective_n', 'gelman_rubin', 'geweke'] | ||
|
||
|
||
def effective_n(trace, varnames=None, round_to=2): | ||
def effective_n(data, *, var_names=None): |
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 didnt know you can use *
as input - what does it do?
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.
It prevents people from using positional arguments, in this case in excess of data
LGTM as well |
These changes get the test suite for
diagnostics.py
to pass, with everything being xarray based. Now will need to work onstats.py
, which will remove (most of) the pandas requirements. I am working on that, but will probably need help for some of the functions (#231) .Note that most functions in
diagnostics.py
work with either a dataset, or a numpy array.