holoviews
holoviews copied to clipboard
Pass the `backend` in `holoviews.opts.defaults`
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)
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).
If I have a reference test, I could try and add that.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 88.86%. Comparing base (
7aaeebc) to head (d287960). Report is 5 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #6331 +/- ##
==========================================
+ Coverage 88.83% 88.86% +0.03%
==========================================
Files 328 328
Lines 69805 69831 +26
==========================================
+ Hits 62010 62055 +45
+ Misses 7795 7776 -19
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Thank you for the PR, this will be part of the next release 1.21.0.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.