Skip to content

Commit

Permalink
Merge branch 'main' into postpone_bokeh_import
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Nov 12, 2024
2 parents f40c7e3 + da8719e commit 6cb82d4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
7 changes: 0 additions & 7 deletions geoviews/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,3 @@ def pytest_collection_modifyitems(config, items):
import matplotlib.pyplot as plt

plt.switch_backend("agg")

with suppress(Exception):
# From Dask 2024.3.0 they now use `dask_expr` by default
# https://github.com/dask/dask/issues/10995
import dask

dask.config.set({"dataframe.query-planning": False})
15 changes: 12 additions & 3 deletions geoviews/util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from contextlib import suppress

import numpy as np
import shapely
import shapely.geometry as sgeom
Expand Down Expand Up @@ -652,9 +654,16 @@ def from_xarray(da, crs=None, apply_transform=False, nan_nodata=False, **kwargs)
'defaulting to non-geographic element.')
elif hasattr(da, 'rio') and da.rio.crs is not None:
# rioxarray.open_rasterio
try:
kwargs['crs'] = process_crs(da.rio.crs.to_proj4())
except Exception:
crs = None
# to handle rasterio 1.4.1 vs 1.4.2 differences
# https://github.com/holoviz/geoviews/pull/763
for method_name in ("to_epsg", "to_proj4"):
with suppress(Exception):
crs = process_crs(getattr(da.rio.crs, method_name)())
break
if crs:
kwargs['crs'] = crs
else:
warn(f'Could not decode projection from crs string {da.rio.crs}, '
'defaulting to non-geographic element.')

Expand Down
1 change: 0 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ sync-git-tags = 'python scripts/sync_git_tags.py geoviews'
[activation.env]
PYTHONIOENCODING = "utf-8"
USE_PYGEOS = "0"
DASK_DATAFRAME__QUERY_PLANNING = "False"

[environments]
test-310 = ["py310", "test-core", "test-unit-task", "test", "example", "test-example", "download-data"]
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ filterwarnings = [
"ignore:\\s*Pyarrow will become a required dependency of pandas:DeprecationWarning", # Will go away by itself in Pandas 3.0
"ignore:Passing a (SingleBlockManager|BlockManager) to (Series|GeoSeries|DataFrame|GeoDataFrame) is deprecated:DeprecationWarning", # https://github.com/holoviz/spatialpandas/issues/137
"ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning:dateutil.tz.tz", # https://github.com/dateutil/dateutil/pull/1285
# 2024-02
"ignore:The current Dask DataFrame implementation is deprecated:DeprecationWarning", # https://github.com/dask/dask/issues/10917
# 2024-03
"ignore:\\s*Dask dataframe query planning is disabled because dask-expr is not installed:FutureWarning",
"ignore:numpy.ndarray size changed, may indicate binary incompatibility:RuntimeWarning", # https://github.com/pydata/xarray/issues/7259
Expand Down

0 comments on commit 6cb82d4

Please sign in to comment.