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

Regression from 1.15.0 with python callables #5622

Open
ludwigVonKoopa opened this issue Feb 11, 2023 · 2 comments
Open

Regression from 1.15.0 with python callables #5622

ludwigVonKoopa opened this issue Feb 11, 2023 · 2 comments

Comments

@ludwigVonKoopa
Copy link

Hi,

I've been playing around with holoviews and datashader operation, and discovered some changes between v1.14.9 and v1.15.0.

I usually build custom datashader operations for dynamic visualisation of big dataset, and i have to optimize operations for the visualisation to be smooth.

Before 1.14.9, when the holoviews.core.operation.Operation._process function was called, every print method was sent to the browser console log.
With holoviews >= 1.15.0, it seems print are no longer in the browser console.

example gif with holoviews 1.14.9 :
holoviews_v1 14 9

same example with holoviews 1.15.0 :
holoviews_v1 15 0

with upgrading 1.14.9 => 1.15.0, I noticed that the number of call to holoviews.core.operation.Operation._process was reduced for pane movement, the holoviews object wait till the click is released which i agree is a massive improvement (callbacks no longer stacks). Same for zooming which wait until the zoom is finished instead of computing the image every zoom done.

I noticed in the changelog that there was changes made with javascript callbacks (pull #4329) and some commits are about javascript, but i did not dig deeper about it because my javascript knowledge is limited.

Is the delete of print in webbrowser console log something wanted ?
Is there a way to have both print in logs AND improvements about callbacks number and stacking ?

For now, i have to develop my functions in 1.14.9 in order to have logs when i play with panning and zooming, to see how many times my function take to rasterize for example, or some logs.
Then i deploy those function in an conda env with holoviews >= 1.15.0.

Thanks

@hoxbro
Copy link
Member

hoxbro commented Feb 12, 2023

Can you update your holoviews version to 1.15.4 and see if the problem still occurs?

If it does, please paste your code for easy access.

@ludwigVonKoopa
Copy link
Author

ludwigVonKoopa commented Feb 12, 2023

Hi,

Same thing with holoviews 1.15.4 :
holoviews_v1 15 4

code to reproduce (same code used for gif) :

import holoviews as hv
import numpy as np
hv.extension("bokeh")

from holoviews.operation.datashader import rasterize, spread
class custom_operation(rasterize):
    iteration = 0
    
    def _process(self, element, key=None):
        x, y = self.p.x_range if self.p.x_range else (0.0, 0.0)
        print(f"{self.iteration:03d} | x={x:10.6f}, y={y:10.6f}")
        self.iteration += 1
        return super()._process(element, key)
    
random_points = np.random.multivariate_normal((0,0), [[0.1, 0.1], [0.1, 1.0]], (1000,))
spread(custom_operation( hv.Points(random_points, label="Points") ))

(I used spread operation only for visualisation purpose, or the points won't be big enough for the gif. The problem still occur without this operation)

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

No branches or pull requests

2 participants