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

Stream callback invoked twice in FastGridTemplate #6810

Open
1 task
yt87 opened this issue May 5, 2024 · 0 comments
Open
1 task

Stream callback invoked twice in FastGridTemplate #6810

yt87 opened this issue May 5, 2024 · 0 comments
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@yt87
Copy link

yt87 commented May 5, 2024

Thanks for contacting us! Please read and follow these instructions carefully, then delete this introductory text to keep your issue easy to read. Note that the issue tracker is NOT the place for usage questions and technical assistance; post those at Discourse instead. Issues without the required information below may be closed immediately.

ALL software version info

panel                     1.4.2              pyhd8ed1ab_0    conda-forge
holoviews                 1.18.3             pyhd8ed1ab_0    conda-forge
hvplot                    0.9.2              pyhd8ed1ab_0    conda-forge
panel                     1.4.2              pyhd8ed1ab_0    conda-forge
xarray                    2024.3.0           pyhd8ed1ab_0    conda-forge

Description of expected behavior and the observed behavior

The code below runs as expected. When I replace FastListTemplate by FastGridTemplate, the function image is invoked twice per each tap. The output for 2 random taps looks like this:

FastListTemplate

=====1 212.17401500938087 40.78488372093024 Sun May  5 01:02:34 2024
=====2 212.17401500938087 40.78488372093024 Sun May  5 01:02:36 2024
=====1 225.90370018975332 30.416666666666664 Sun May  5 01:02:38 2024
=====2 225.90370018975332 30.416666666666664 Sun May  5 01:02:40 2024

FastGridTemplate

=====1 215.59535104364326 36.36904761904762 Sun May  5 01:01:48 2024
=====2 215.59535104364326 36.36904761904762 Sun May  5 01:01:50 2024
=====1 215.59535104364326 36.36904761904762 Sun May  5 01:01:51 2024
=====2 215.59535104364326 36.36904761904762 Sun May  5 01:01:53 2024
=====1 259.3429791271347 68.21428571428571 Sun May  5 01:01:58 2024
=====2 259.3429791271347 68.21428571428571 Sun May  5 01:02:00 2024
=====1 259.3429791271347 68.21428571428571 Sun May  5 01:02:00 2024
=====2 259.3429791271347 68.21428571428571 Sun May  5 01:02:02 2024

Complete, minimal, self-contained example code that reproduces the issue

# code goes here between backticks
import time

import panel as pn
import xarray as xr
import holoviews as hv
import hvplot.xarray

pn.extension()

ds = xr.tutorial.open_dataset('air_temperature')
_image = ds.hvplot('lon', 'lat')
stream = hv.streams.Tap(source=_image, x=-88 + 360, y=40)

def image(x, y):
    print('=====1', x, y, time.ctime())
    time.sleep(2)
    print('=====2', x, y, time.ctime())
    return _image * hv.Points([(x, y)], label='x: %0.3f, y: %0.3f' % (x, y)).opts(color='red', size=10)


item = pn.bind(image, stream.param.x, stream.param.y)
layout = pn.template.FastListTemplate(title='FastList', main=[item])
#layout = pn.template.FastGridTemplate(title='FastGrid')
#layout.main[0:6, 0:6] = item
layout.servable()

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

  • I may be interested in making a pull request to address this
@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label May 6, 2024
@philippjfr philippjfr added this to the v1.4.3 milestone May 6, 2024
@philippjfr philippjfr modified the milestones: v1.4.3, v1.4.4 May 30, 2024
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

No branches or pull requests

2 participants