Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

plot_hdi: add exception if x is type np.datetime64 and smooth=True #2016

Merged
merged 7 commits into from
Jul 11, 2022

Conversation

drbenvincent
Copy link
Contributor

In #1968 I pointed out that az.plot_hdi failed if x was of type datetime when smooth=True. This PR adds an exception to hopefully make this easier for a user to work out what is going wrong.

FYI this is my first PR to arviz, so apologies if I've missed some steps.

@drbenvincent drbenvincent changed the title plot_hdi: add exception if x is type np.datetime64 and smooth=True plot_hdi: add exception if x is type np.datetime64 and smooth=True Apr 17, 2022
@codecov
Copy link

codecov bot commented Apr 17, 2022

Codecov Report

Merging #2016 (eb05905) into main (b2b9cbc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2016   +/-   ##
=======================================
  Coverage   90.74%   90.75%           
=======================================
  Files         117      117           
  Lines       12453    12455    +2     
=======================================
+ Hits        11301    11303    +2     
  Misses       1152     1152           
Impacted Files Coverage Δ
arviz/plots/hdiplot.py 92.72% <100.00%> (+0.27%) ⬆️

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 b2b9cbc...eb05905. Read the comment docs.

@OriolAbril
Copy link
Member

Looks great, thanks! Can you add a test similar to https://github.com/arviz-devs/arviz/blob/main/arviz/tests/base_tests/test_plots_matplotlib.py#L1188 to check this error is thrown when datetime data is passed (and we therefore don't remove it unkowingly in the future)

@OriolAbril OriolAbril force-pushed the plot_hdi_exception branch from 25316d1 to 7010559 Compare July 8, 2022 17:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants