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: RangeXY now provides incorrect longitude x_range #753

Open
TheoMathurin opened this issue Oct 4, 2024 · 8 comments · May be fixed by #756
Open

Regression: RangeXY now provides incorrect longitude x_range #753

TheoMathurin opened this issue Oct 4, 2024 · 8 comments · May be fixed by #756

Comments

@TheoMathurin
Copy link

ALL software version info

I think only hv and gv versions are relevant

geoviews 1.13.0
holoviews 1.19.1

Description of expected behavior and the observed behavior

Potentially a serious regression that breaks a lot of things in my apps.

Assuming a Plate Carree crs, longitudes returned by hv.streams.RangeXY were always given between -180 et 180.

They are now given in the (0, 360) interval when they are both in the western hemisphere.

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

import panel as pn
import holoviews as hv
import geoviews as gv


def print_xrange(x_range, y_range):
    text.object = f'x_range: {x_range}'


coastline = gv.feature.coastline
xy_range = hv.streams.RangeXY(source=coastline)
xy_range.add_subscriber(print_xrange)
text = pn.pane.Str('')

pn.Column(coastline, text).servable()

Stack traceback and/or browser JavaScript console output

No errors

Screenshots or screencasts of the bug in action

Capture.video.du.2024-10-04.16-29-54.mp4
@TheoMathurin TheoMathurin changed the title Regression: RangeXY now provides incorrect x_range Regression: RangeXY now provides incorrect longitude x_range Oct 4, 2024
@hoxbro
Copy link
Member

hoxbro commented Oct 4, 2024

Do you know if it is HoloViews or Geoviews release which broke it?

Maybe #722 is the culprit.

@TheoMathurin
Copy link
Author

Thanks for the quick response.

I happened to update both at the same time but will investigate.

@hoxbro
Copy link
Member

hoxbro commented Oct 4, 2024

Easier to downgrade holoviews first.

@hoxbro
Copy link
Member

hoxbro commented Oct 4, 2024

Can you comment out these lines:

if plot._unwrap_lons and -180 <= x0 < 0 or -180 <= x1 < 0:
x0, x1 = x0 + 360, x1 + 360
if x0 > x1:
x0, x1 = x1, x0

@TheoMathurin
Copy link
Author

I won't have the opportunity to try before Monday, but looks promising

@TheoMathurin
Copy link
Author

Removing these lines does solve the problem!

As an aside, I tried with holoviews 1.18.3 and geoviews 1.13.0 but by default it installed panel 1.5.2 which is not compatible with 1.18.3 it seems:

  File "/home/mathurin/miniconda3/envs/test-range/lib/python3.12/site-packages/holoviews/core/util.py", line 1634, in resolve_dependent_value
    from panel.depends import param_value_if_widget
ImportError: cannot import name 'param_value_if_widget' from 'panel.depends'

@TheoMathurin
Copy link
Author

TheoMathurin commented Oct 16, 2024

@hoxbro @ahuang11

I don't know how to move forward on this one. I guess the solution is not to remove the lines mentioned above, since the changes brought by #722 had a purpose of their own.

Currently everything relying on RangeXY in PlateCarree CRS is going to be affected, including datashader range updates.

@ahuang11
Copy link
Collaborator

ahuang11 commented Oct 16, 2024

@TheoMathurin can you try #756 and see if that fixes your issues?

#756 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants