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

Pass the backend in holoviews.opts.defaults #6331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LecrisUT
Copy link
Contributor

@LecrisUT LecrisUT commented Jul 18, 2024

This is a quick issue I've found when trying to run:

holoviews.opts.defaults(
    holoviews.opts.Curve(
        fig_size=500,
        linewidth=1,
    ),
    backend="matplotlib",
)

Because the backend is not propagated when doing _expand_options you get:

WARNING:param.main: Option 'fig_size' for Curve type not valid for selected backend ('bokeh'). Option only applies to following backends: ['matplotlib']

It seems that the options are indeed not populated due to the warning (confirmed, that with this PR, the default is set appropriately)

@LecrisUT LecrisUT changed the title Pass the backend in opts Pass the backend in holoviews.opts.defaults Jul 18, 2024
@ahuang11 ahuang11 added the type: bug Something isn't correct or isn't working label Jul 26, 2024
@ahuang11
Copy link
Collaborator

ahuang11 commented Jul 26, 2024

Thank you for contributing! To make HoloViews more robust do you think you can add a test that checks if opts are propagated properly using hv.opts.defaults or alternatively checking if the warning is gone?

Maybe in https://github.com/holoviz/holoviews/blob/main/holoviews/tests/plotting/test_plotutils.py (not 100% certain).

@LecrisUT
Copy link
Contributor Author

LecrisUT commented Aug 2, 2024

If I have a reference test, I could try and add that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants