ArcticSnow / TopoPyScale

TopoPyScale: a Python library to perform simplistic climate downscaling at the hillslope scale
https://topopyscale.readthedocs.io
MIT License
39 stars 9 forks source link

Xarray rasterio backend deprecation URGENT! #72

Closed joelfiddes closed 1 year ago

joelfiddes commented 1 year ago

see "breaking changes" https://docs.xarray.dev/en/stable/whats-new.html#v2023-04-2-april-20-2023

and https://github.com/pydata/xarray/issues/4697

Affects at least:

File "/home/joel/src/TopoPyScale/TopoPyScale/topo_param.py", line 141, in compute_dem_param ds = xr.open_rasterio(dem_file).to_dataset('band') AttributeError: module 'xarray' has no attribute 'open_rasterio'

Alternative:

rioxarray.open_rasterio

todo:

conda install -c conda-forge rioxarray add import rioxarry to topo_param.py and topo_da.py change all cases of xr.open_rasterio to rioxarray.open_rasterio

joelfiddes commented 1 year ago

i can push these changes but be aware it will break stuff - although anyone with latest xarray package will not be able to currently run code anyway......

joelfiddes commented 1 year ago

pushed commits

joelfiddes commented 1 year ago

pushed commits