-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Rename api for plots and io #248
Conversation
8a0662d
to
fa0d723
Compare
Is there something we need to fix for the |
I wouldn't worry about that here - the API doc will pick it up automatically, but all the examples will need to change. |
maybe a sphinx directive too, but i can wrestle with 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 like this - thanks for being so thorough. If it is too much to change the plot file names and plot function names, feel free to merge, and we can do that in a followup.
arviz/plots/__init__.py
Outdated
from .khatplot import khatplot | ||
from .ppcplot import ppcplot | ||
from .violintraceplot import violintraceplot | ||
from .autocorrplot import autocorrplot as plot_autocorr |
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 we rename the files and functions as well?
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.
Yes we can.
It will affect plots/init only.
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 we leave the modulenames/filenames the same? I feel like renaming the functions should be sufficient.
arviz/plots/__init__.py
Outdated
from .densityplot import densityplot as plot_density | ||
from .energyplot import energyplot as plot_energy | ||
from .forestplot import forestplot as plot_forest | ||
from .kdeplot import kdeplot as plot_kde, _fast_kde, _fast_kde_2d |
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.
If were exposing _fast_kde
, and _fast_kde_2d
for users we should remove the underscore to make it obvious its meant for end users.
If we don't intend for users to use this method we should remove it from the import
def pystan_to_inference_data(*, fit=None, prior=None, posterior_predictive=None, | ||
observed_data=None, log_likelihood=None, coords=None, dims=None): | ||
"""Convert pystan data into an InferenceData object.""" | ||
def from_pystan(*, fit=None, prior=None, posterior_predictive=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.
This documentation is great. Thank you!
Thank you for getting this renaming started! |
Felt guilty for merging my changes, and then got a little caught up renaming the plot functions, and now I feel bad that #249 will need to be rebased, but I am now happy with these changes. Looking at other PR now. |
Don't worry! I can deal with a rebase. I'll get to it when I get back home
in 1.5 hours
…On Tuesday, September 18, 2018, Colin ***@***.***> wrote:
Felt guilty for merging my changes, and then got a little caught up
renaming the plot functions, and now I feel bad that #249
<#249> will need to be rebased,
but I am now happy with these changes. Looking at other PR now.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#248 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AG4S4Q2OS9VPKK8Q_geQjQ7a25lb6gjsks5ucaBigaJpZM4Wunky>
.
|
from .densityplot import plot_density | ||
from .energyplot import plot_energy | ||
from .forestplot import plot_forest | ||
from .kdeplot import plot_kde, _fast_kde, _fast_kde_2d |
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.
Are these supposed to be private at the in init.py?
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.
Yes, I think they should be, because they are not meant for the average user.
I think they still propagate to main namespace?
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.
Yes but only because we import them into init.py I believe. I think if we don't import them here they won't propagate to the main namespace.
In either case I'm not too worried about it now and don't want to block this for something this minor, especially since "private" isn't even a real thing in Python.
io contains now
convert_to_inference_data
now contains**kwargs
and they are passed forfrom_pymc3
andfrom_pystan
functions.All the plots are imported to
plots.__init__
asThis will keep the names of the files and everything normal.