After upgrading holoviews from 1.13.3 to 1.13.4 hvplot.xarray.image(rasterize=True, dynamic=True) no longer works. displayed image resolution is not updated upon zooming into an image plot
(linux or macos)
conda create -n holoviews python=3.7 holoviews xarray rasterio hvplot datashader jupyter
holoviews 1.13.4 pyh9f0ad1d_0 conda-forge
bokeh 2.2.2 py37hc8dfbb8_0 conda-forge
hvplot 0.6.0 pyh9f0ad1d_0 conda-forge
datashader 0.11.1 pyh9f0ad1d_0 conda-forge
Zooming into a subregion of an image with raster with rasterize=True, dynamic=True should update displayed resolution
This uses an example image from AWS public data
import os
import xarray as xr
import hvplot.xarray
os.environ['GDAL_DISABLE_READDIR_ON_OPEN']='EMPTY_DIR'
os.environ['AWS_NO_SIGN_REQUEST']='YES'
href = 's3://sentinel-s1-rtc-indigo/tiles/RTC/1/IW/10/T/ET/2020/S1B_20200106_10TET_ASC/Gamma0_VV.tif'
da = xr.open_rasterio(href)
da.hvplot.image(rasterize=True, dynamic=True, clim=(0,0.4), aspect='equal', frame_width=600, cmap='gray')
No tracebacks, not sure how to output console messages.
downgrading to holoviews 1.13.3 things work as expected. cc @rsignell-usgs
downgrading is not ideal because we'd be back to this issue that was solved in 1.13.4 https://github.com/holoviz/hvplot/issues/462
@scottyhq , thanks for reporting this. I was thinking that somehow I broke it. Luckily I didn't have a live demo today.
@jbednar , do you think holoviz will stabilize at some point, or are we always likely to feel this pain due to the complexity of the package dependencies?
Good question. If you have any influence, try to get @jsignell to come back to the project so that things will run more smoothly. :-) Meanwhile, I can't comment on what this particular issue indicates about stability, since I can't see what the problem could be.
I don't have rasterio in my usual environment but this problem appears to be reproducible with one of the stock examples:
import xarray as xr
import hvplot.xarray
air = xr.tutorial.open_dataset('air_temperature').load().air
air2d = air.sel(time='2013-06-01 12:00')
air2d.hvplot.image(width=400, rasterize=True)
Here the image updates with either rasterize or datashade for hv=1.13.3, but for hv=1.13.4 or hv=1.14.0a2, it only updates for datashade=True, not rasterize=True. The same happens for rasterize(air2d.hvplot.image(width=400)), so I've moved it from hvPlot to HoloViews, where I'm assuming the problem originates (and also since it depends on the hv version and not the hvPlot version).
I didn't see any relevant warnings or errors on the console. @philippjfr ?
Also, the behavior even when it is working looks dubious on that example; it jumps around more than the resolution of the image would indicate to me. I think there is an off-by-one error somewhere in the raster rendering code, which wouldn't be visible for a large enough image but is revealed by this low-resolution one.
Fixed in https://github.com/holoviz/holoviews/pull/4654, will release 1.13.5 tomorrow.
Also I really don't understand why tests didn't catch this one but I'll add some more to that PR.
thanks for the speedy fix @philippjfr , much appreciated!!
Unfortunately with holoviews=1.13.5, it seems we are back to the wacky zoom problems again: https://github.com/holoviz/holoviews/issues/4052#issuecomment-717194601
Most helpful comment
Fixed in https://github.com/holoviz/holoviews/pull/4654, will release 1.13.5 tomorrow.