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

resampling_when breaks when zooming in #6372

Closed
ahuang11 opened this issue Sep 16, 2024 · 2 comments · Fixed by #6373
Closed

resampling_when breaks when zooming in #6372

ahuang11 opened this issue Sep 16, 2024 · 2 comments · Fixed by #6373
Labels
type: bug Something isn't correct or isn't working

Comments

@ahuang11
Copy link
Collaborator

ahuang11 commented Sep 16, 2024

import hvplot.pandas
import panel as pn
import pandas as pd

df = pd.DataFrame({
    "lon": [45.5531, 46.4731, 47.4731, 48.41234],
    "lat": [34.5531, 35.4731, 36.4731, 37.41234],
})

pn.serve((df.hvplot.points("lon", "lat", rasterize=True, resample_when=1000)))
image
WARNING:bokeh.core.validation.check:W-1005 (FIXED_SIZING_MODE): 'fixed' sizing mode requires width and height to be set: figure(id='p1110', ...)
WARNING:param.dynamic_operation: Callable raised "ValueError("conflicting sizes for dimension 'lon': length 730 on the data but length 365 on coordinate 'lon'")".
Invoked as dynamic_operation(height=300, scale=1.0, width=365, x_range=(32.55793907008026, 49.477519405740225), y_range=(17.986703041165143, 30.624333539380807))
Traceback (most recent call last):
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/plotting/util.py", line 293, in get_plot_frame
    return map_obj[key]
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 1216, in __getitem__
    val = self._execute_callback(*tuple_key)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 983, in _execute_callback
    retval = self.callback(*args, **kwargs)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 552, in __call__
    return self.callable()
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/overlay.py", line 34, in dynamic_mul
    element = other[args]
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 1216, in __getitem__
    val = self._execute_callback(*tuple_key)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 983, in _execute_callback
    retval = self.callback(*args, **kwargs)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 552, in __call__
    return self.callable()
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/util/__init__.py", line 1038, in dynamic_operation
    key, obj = resolve(key, kwargs)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/util/__init__.py", line 1027, in resolve
    return key, map_obj[key]
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 1216, in __getitem__
    val = self._execute_callback(*tuple_key)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 983, in _execute_callback
    retval = self.callback(*args, **kwargs)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 552, in __call__
    return self.callable()
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 197, in dynamic_mul
    self_el = self.select(HoloMap, **key_map) if self.kdims else self[()]
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 1216, in __getitem__
    val = self._execute_callback(*tuple_key)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 983, in _execute_callback
    retval = self.callback(*args, **kwargs)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/spaces.py", line 581, in __call__
    ret = self.callable(*args, **kwargs)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/util/__init__.py", line 1039, in dynamic_operation
    return apply(obj, *key, **kwargs)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/util/__init__.py", line 1031, in apply
    processed = self._process(element, key, kwargs)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/util/__init__.py", line 1013, in _process
    return self.p.operation.process_element(element, key, **kwargs)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/operation.py", line 194, in process_element
    return self._apply(element, key)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/operation.py", line 141, in _apply
    ret = self._process(element, key)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/operation/datashader.py", line 1542, in _process
    agg = rasterize._process(self, element, key)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/operation/datashader.py", line 1522, in _process
    element = element.map(op, predicate)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/data/__init__.py", line 196, in pipelined_fn
    result = method_fn(*args, **kwargs)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/data/__init__.py", line 1213, in map
    return super().map(*args, **kwargs)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/dimension.py", line 695, in map
    return map_fn(self) if applies else self
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/operation.py", line 214, in __call__
    return self._apply(element)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/core/operation.py", line 141, in _apply
    ret = self._process(element, key)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/holoviews/operation/datashader.py", line 374, in _process
    xarray = xr.DataArray(np.full((height, width), empty_val),
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/xarray/core/dataarray.py", line 443, in __init__
    coords, dims = _infer_coords_and_dims(data.shape, coords, dims)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/xarray/core/dataarray.py", line 188, in _infer_coords_and_dims
    _check_coords_dims(shape, new_coords, dims_tuple)
  File "/Users/ahuang/miniconda3/envs/hvplot/lib/python3.10/site-packages/xarray/core/dataarray.py", line 126, in _check_coords_dims
    raise ValueError(
ValueError: conflicting sizes for dimension 'lon': length 730 on the data but length 365 on coordinate 'lon'
@ahuang11 ahuang11 added the type: bug Something isn't correct or isn't working label Sep 16, 2024
@ahuang11 ahuang11 changed the title resampling_when breaks when zooming in resampling_when breaks when zooming in with geo=True Sep 16, 2024
@ahuang11 ahuang11 changed the title resampling_when breaks when zooming in with geo=True resampling_when breaks when zooming in Sep 16, 2024
@ahuang11
Copy link
Collaborator Author

I think this is caused by pixel_ratio.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant