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

feat(eda): added density parameter to plot_diff(df) #698

Merged
merged 2 commits into from
Oct 26, 2021

Conversation

devinllu
Copy link
Contributor

@devinllu devinllu commented Oct 5, 2021

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes Issue #683

  • Added density parameter to plot_diff(df)
  • Refactored some existed functions such as kde_viz()
  • Displays density histograms when proper config object is passed in (Ex: {diff.density: True})

How Has This Been Tested?

Manually tested via Jupyter Notebook

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Snapshot of tests included below

Snapshots:

Include snapshots for easier review.

Screen Shot 2021-10-05 at 12 07 35 AM

Checklist:

  • My code follows the style guidelines of this project
  • I have already squashed the commits and make the commit message conform to the project standard.
  • I have already marked the commit with "BREAKING CHANGE" or "Fixes #" if needed.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

return fig


def kde_viz_panel(
Copy link
Contributor

Choose a reason for hiding this comment

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

I find the code of kde_viz_panel is almost same as kde_viz_figure. Could we just call kde_viz_figure in kde_viz_panel? E.g.,

fig = kde_viz_figure(...)
return panel(fig)...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screen Shot 2021-10-12 at 12 55 43 PM

Normally I would've just made both of these into 1 function, however if you look at the return types they're both different (one specifically returns Panel, the other Figure). That's why I wrote 2 different functions. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

In the kde_viz_panel function, you could first get fig using kde_viz_figure function, then warp it to the Panel type and return. In this way the code of generating fig part is not redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see what you're saying I misread it

@jinglinpeng
Copy link
Contributor

Hi @devinllu , good job! I think we can merge the PR after you rebase and fix my last comment.

feat(eda): added density parameter to plot_diff(df)

refactor(eda): ran just ci tests

refactor: changed kde_viz_panel() into a wrapper
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