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

[WIP] Add a parameter to enable/disable smoothing on discrete variables in BLV (Issue #2325) #2344

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Patchouli-Kenntnis
Copy link

@Patchouli-Kenntnis Patchouli-Kenntnis commented Apr 8, 2024

Description

Add a parameter smoothing, default as True, to toggle smoothing on data with integer type.

Checklist

  • Follows official PR format
  • Includes a sample plot to visually illustrate the changes (only for plot-related functions)
  • 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

📚 Documentation preview 📚: https://arviz--2344.org.readthedocs.build/en/2344/

@Patchouli-Kenntnis
Copy link
Author

Since I'm a newcomer here, I'm not sure how to comply with pylint (Your code has been rated at 10.00/10
##[error]Bash exited with code '16'.
Finishing: pylint
) and build the read the docs.
Hope for some generous assistance to help me get into the workflow.

Copy link
Member

@OriolAbril OriolAbril left a comment

Choose a reason for hiding this comment

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

You can see the pylint errors on the CI log (locally you should get something similar); rating isn't really useful, the important thing are the errors you get.

As for docs and failure of the other tests, you are introducing a new argument but it has only been added to matplotlib backend. You need to do the same change to bokeh, otherwise when plot_bpv calls the bokeh backend function it does so with incorrect arguments.

Copy link
Contributor

@tomicapretto tomicapretto left a comment

Choose a reason for hiding this comment

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

Hi @Patchouli-Kenntnis, thanks for the contribution!

Another two comments from the CI log

************* Module arviz.plots.bpvplot
arviz/plots/bpvplot.py:172:0: C0301: Line too long (116/100) (line-too-long)

That one is saying the line 172 in arviz/plots/bpvplot.py is longer than the maximum length we allow in ArviZ (100). You need to split that into two lines.

************* Module arviz.plots.backends.matplotlib.bpvplot
arviz/plots/backends/matplotlib/bpvplot.py:91:73: C0121: Comparison 'smoothing == True' should be 'smoothing is True' if checking for the singleton value True, or 'bool(smoothing)' if testing for truthiness (singleton-comparison)

does not raise an error per se, but it suggests a more robust practice to test if a value is equal to True (i..e use something is True instead of something == True).


Let me know if you need help with anything :)

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.

3 participants