Skip to content
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 skipna argument to plot_posterior #1432

Merged
merged 4 commits into from
Nov 6, 2020
Merged

Conversation

aloctavodia
Copy link
Contributor

@aloctavodia aloctavodia commented Oct 26, 2020

Plot posterior fails if nan are present, this adds a skipna argument, defaults to False.

  • Follows official PR format
  • New features are properly documented (with an example if appropriate)?
  • Includes new or updated tests to cover the new feature
  • Code style correct (follows pylint and black guidelines)
  • Changes are listed in changelog

@codecov
Copy link

codecov bot commented Oct 26, 2020

Codecov Report

Merging #1432 into master will decrease coverage by 0.00%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1432      +/-   ##
==========================================
- Coverage   91.97%   91.96%   -0.01%     
==========================================
  Files         105      105              
  Lines       11173    11179       +6     
==========================================
+ Hits        10276    10281       +5     
- Misses        897      898       +1     
Impacted Files Coverage Δ
arviz/plots/posteriorplot.py 87.50% <ø> (ø)
arviz/stats/stats.py 96.05% <ø> (ø)
arviz/plots/plot_utils.py 91.10% <85.71%> (-0.28%) ⬇️
arviz/plots/backends/bokeh/posteriorplot.py 98.14% <100.00%> (+0.03%) ⬆️
arviz/plots/backends/matplotlib/posteriorplot.py 98.24% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ead5c98...a997684. Read the comment docs.


Returns
-------
point_value : float
best estimate of data distribution
"""
print("ski", skipna)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the print?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad!

@@ -579,7 +585,10 @@ def calculate_point_estimate(point_estimate, values, bw="default", circular=Fals
else:
point_value = mode(values)[0][0]
elif point_estimate == "median":
point_value = np.median(values)
if skipna:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add tests for this specific function as well at the plotting level

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a test for skipna (True or False) for both matplotlib and bokeh. What else is needed?

@aloctavodia
Copy link
Contributor Author

@canyon289 I think this is ready to merge.

@aloctavodia aloctavodia merged commit 73f90a2 into master Nov 6, 2020
@aloctavodia aloctavodia deleted the nan_posterior_plot branch November 6, 2020 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants