sbi-dev / sbi

Simulation-based inference toolkit
https://sbi-dev.github.io/sbi/
Apache License 2.0
546 stars 133 forks source link

Omit nans in plotting functions, cast to numpy before plotting, fix axes indexing for 1D #1185

Closed Matthijspals closed 1 week ago

Matthijspals commented 2 weeks ago

What does this implement/fix? Explain your changes

Does this close any currently open issues?

Fixes #1184 #1059

Any relevant code examples, logs, error output, etc?

Any other comments?

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 72.00000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 75.78%. Comparing base (6f61662) to head (e009fef).

:exclamation: There is a different number of reports uploaded between BASE (6f61662) and HEAD (e009fef). Click for more details.

HEAD has 1 upload more than BASE | Flag | BASE (6f61662) | HEAD (e009fef) | |------|------|------| |unittests|1|2|
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1185 +/- ## ========================================== - Coverage 82.13% 75.78% -6.36% ========================================== Files 93 93 Lines 7458 7476 +18 ========================================== - Hits 6126 5666 -460 - Misses 1332 1810 +478 ``` | [Flag](https://app.codecov.io/gh/sbi-dev/sbi/pull/1185/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/sbi-dev/sbi/pull/1185/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev) | `75.78% <72.00%> (-6.36%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/sbi-dev/sbi/pull/1185?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev) | Coverage Δ | | |---|---|---| | [sbi/analysis/plot.py](https://app.codecov.io/gh/sbi-dev/sbi/pull/1185?src=pr&el=tree&filepath=sbi%2Fanalysis%2Fplot.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev#diff-c2JpL2FuYWx5c2lzL3Bsb3QucHk=) | `66.15% <72.00%> (+24.36%)` | :arrow_up: | ... and [23 files with indirect coverage changes](https://app.codecov.io/gh/sbi-dev/sbi/pull/1185/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev)
Matthijspals commented 1 week ago

I added tests. Not sure about what counts as a slow test. on my Mac, pytest tests/plot_test.py take 14.18s

janfb commented 1 week ago

Yes, please see this comment: https://github.com/sbi-dev/sbi/pull/1147#issuecomment-2098352798

Please note that we should only build the website locally (mkdocs serve) and not deploy it yet, because we want the docs and API refs on the website to be in sync with the latest release (Dec 2023).