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

Intempestive call with None args in DynamicMaps if hv.Dimension with unit is provided #5900

Closed
TheoMathurin opened this issue Nov 21, 2023 · 0 comments · Fixed by #5904
Closed

Comments

@TheoMathurin
Copy link
Contributor

TheoMathurin commented Nov 21, 2023

The issue was introduced in the 1.3.0 release. It does come from Panel as I'm using the same HoloViews version (1.18.1) and it works fine with Panel 1.2.3.

Following #5535, I added units to kdims in my DynamicMaps.

This causes an issue where the callable is called twice on render, once with the expected kdim value and then once with None. Any subsequent slider manipulation does not trigger calls as presumably the value remains None.

Consider the following code, if you set the unit to None it works, but anything else leads to a second call with f=None.

import numpy as np
import holoviews as hv
import panel as pn

hv.extension('bokeh')


def function(f):
    print(f)
    if f is None:
        f = 0
    return hv.Curve((x, np.sin(f*x)))

x = np.linspace(0, 10)
unit = 'unit'
factor = hv.Dimension('factor', unit=unit)
dmap = hv.DynamicMap(function, kdims=factor).opts(width=600)
dmap = dmap.redim.values(factor=[1, 2, 3, 4, 5])

pn.Column(dmap).servable()

Note that this does not happen for HoloMaps.

No error is logged either in Python or in the browser.

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 a pull request may close this issue.

1 participant