-
Notifications
You must be signed in to change notification settings - Fork 160
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
961 pairplot #1084
961 pairplot #1084
Conversation
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.
high-level review: This is so great!!! Thanks a ton for improving the plotting 🎉
Before a detailed review,
- can you please add type annotations to the arguments of the new functions,
- and run
pre-commit
hooks. it seems the formatting is inconsistent. make sure you are usingpre-commit --version
3.5.0. then runpre-commit run --all-files
thanks 🙏
Checks have now passed. I will still update the plot tests (which run but throw many deprecation warnings), add typing for the non main functions, and update the conditional plots next week |
Sorry for being unclear! What I meant is, we should a add a new test for the updated pairplot function (which shouldn't throw deprecation warnings if used correctly) |
The new functions (and old functions used by them) now all have typing. TODOs are:
|
No worries, now I got you and agree. In a world with enough time, should do that. pytest also allows for marks that ignore things on a per-function-level. It didn't work instantly for me, so I went for this solution. Feel free to change it. However, I think that our time is better spent on other things :) |
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.
Great effort!
I added a couple of comments. Will have a look at the tutorial later.
Co-authored-by: Jan <[email protected]>
Co-authored-by: Jan <[email protected]>
Co-authored-by: Jan <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1084 +/- ##
==========================================
- Coverage 76.37% 74.21% -2.17%
==========================================
Files 84 90 +6
Lines 6507 6927 +420
==========================================
+ Hits 4970 5141 +171
- Misses 1537 1786 +249
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: Jan <[email protected]>
Co-authored-by: Jan <[email protected]>
Co-authored-by: Jan <[email protected]>
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.
Sorry for the delay in reviewing!
It all looks good now, except for the two comments about the unused limit kwargs
- I think it's better to remove them.
I also had a look at the tutotial and I think it's great!! 👏
Just one comment: it is using the example_posterior
, so the data is in parameter space. However, you are using x_1
(...) as labels later. I suggest to change this to theta_1
(...) and to replace x_o
with theta_o
.
Thanks again for this revolutionary plotting update! 🙏
Ping @Matthijspals :) |
Hi Jan, sorry for the delay! Do you mean to change:
into:
or to make to limits part of the kwargs Dict? |
No worries!
|
Just dropping the |
Oh, I see. I finally understand why they were there in the first place :) Then I suggest that we just keep them and add an inline comment or info in the docstring why they are there. |
Will do!
The x and y limits are currently set for every plot in the |
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.
Looks good!
Thanks a lot @Matthijspals 👏
What does this implement/fix? Explain your changes
Refactoring of the
pairplot
andmarginal_plot
functions, to make the plotting more transparent and easier to understand.Here is a summary of all changes:
Passing keywords:
upper_kwargs
,lower_kwargs
,diag_kwargs
andfig_kwargs
dictionaries (similar toseaborn
), making it easier to organise keywordsupper_kwargs
,lower_kwargs
, anddiag_kwargs
can includempl_kwargs
, which is directly passed to thematplotlib
plotting function used, making it straightforward to change e.g. thecmap
used.Tutorial:
Restructuring of functions:
get_offdiag_funcs
is declared outside ofpairplot
, bringing it inline withget_diac_funcs
, and makingpairplot
easier to parseplt_hist_1d
,plt_kde_2d
, have their own function, making the code easier to parse, and making it easier to add new functionsarrange_plots
is replaced byarrange_grid
, which uses the newly defined plotting functions and avoids mixingplt
andax
format_subplot
diag
can beNone
to only plot 2D marginalsDoes this close any currently open issues?
Adresses #961
Any relevant code examples, logs, error output, etc?
See here for more examples
Any other comments?
I did not change any of the defaults, as I felt it is quite subjective what is desired, we could discuss whether defaults should be changed or not.
Once this is roughly approved
conditional_pairplot
andconditional_marginal_plot
should be updated to be inline with the new functions.Some tutorial plots should use updated syntax for plotting to avoid throwing deprecation warnings.
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creatingthe 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.
guidelines
with
pytest.mark.slow
.guidelines
main
(or there are no conflicts withmain
)