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

Modified transform parameter in plot_forest to accept dictionary values #2403

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

Conversation

lucifer4073
Copy link

@lucifer4073 lucifer4073 commented Dec 18, 2024

Closes #2117

Key Features:

  • Callable transform: Applies a single transformation to all variables.
    az.plot_forest(data, transform=lambda x: x ** 2)
  • Dictionary transform: Allows variable-specific transformations.
    az.plot_forest(data, transform={"theta": np.exp, "mu": np.log})

Additional Changes:

  • Added test cases to validate the feature.
  • Documentation updated to follow the NumPy style guide.
  • Example script added to demonstrate usage

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

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.72%. Comparing base (adb2fef) to head (c8189dc).

Files with missing lines Patch % Lines
arviz/plots/forestplot.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2403   +/-   ##
=======================================
  Coverage   86.72%   86.72%           
=======================================
  Files         124      124           
  Lines       12908    12919   +11     
=======================================
+ Hits        11194    11204   +10     
- Misses       1714     1715    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lucifer4073 lucifer4073 changed the title Fixes #2117: Modified transform parameter in plot_forest to accept dictionary values Modified transform parameter in plot_forest to accept dictionary values Dec 18, 2024
@lucifer4073
Copy link
Author

Hi @OriolAbril, it would be great if you could review my PR.

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.

[Feature Request] Allow transform to support a dictionary
1 participant