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

RasterioDeprecationWarning #3964

Merged
merged 3 commits into from
Apr 11, 2020
Merged

RasterioDeprecationWarning #3964

merged 3 commits into from
Apr 11, 2020

Conversation

cheginit
Copy link
Contributor

When a vrt is opened, a deprecation warning will be shown:

/home/taher/.local/apps/miniconda/envs/hydrodata/lib/python3.8/site-packages/xarray/backends/rasterio_.py:241: RasterioDeprecationWarning: dst_nodata will be removed in 1.1, use nodata
  riods = WarpedVRT(riods, **vrt_params)
/home/taher/.local/apps/miniconda/envs/hydrodata/lib/python3.8/site-packages/xarray/backends/rasterio_.py:35: RasterioDeprecationWarning: dst_nodata will be removed in 1.1, use nodata
  riods = WarpedVRT(riods, **vrt_params)
/home/taher/.local/apps/miniconda/envs/hydrodata/lib/python3.8/site-packages/xarray/backends/rasterio_.py:122: RasterioDeprecationWarning: dst_nodata will be removed in 1.1, use nodata
  riods = WarpedVRT(riods, **self.vrt_params)

This change can be confirmed in rasterio's documentation where dst_nodata is replaced with nodata.
https://rasterio.readthedocs.io/en/latest/api/rasterio.vrt.html

When a `vrt` is opened, a deprecation warning will be shown:
```python
/home/taher/.local/apps/miniconda/envs/hydrodata/lib/python3.8/site-packages/xarray/backends/rasterio_.py:241: RasterioDeprecationWarning: dst_nodata will be removed in 1.1, use nodata
  riods = WarpedVRT(riods, **vrt_params)
/home/taher/.local/apps/miniconda/envs/hydrodata/lib/python3.8/site-packages/xarray/backends/rasterio_.py:35: RasterioDeprecationWarning: dst_nodata will be removed in 1.1, use nodata
  riods = WarpedVRT(riods, **vrt_params)
/home/taher/.local/apps/miniconda/envs/hydrodata/lib/python3.8/site-packages/xarray/backends/rasterio_.py:122: RasterioDeprecationWarning: dst_nodata will be removed in 1.1, use nodata
  riods = WarpedVRT(riods, **self.vrt_params)
```
This change can be confirmed in `rasterio`'s documentation where `dst_nodata` is replaced with nodata.
https://rasterio.readthedocs.io/en/latest/api/rasterio.vrt.html
@max-sixty
Copy link
Collaborator

Thanks @cheginit ! I know it's a small change, but would you be up for adding a whatsnew entry and giving yourself credit?

@cheginit
Copy link
Contributor Author

Sure!

@max-sixty max-sixty merged commit 745658b into pydata:master Apr 11, 2020
@max-sixty
Copy link
Collaborator

Cheers @cheginit !

@cheginit
Copy link
Contributor Author

Thanks!

@cheginit cheginit deleted the patch-1 branch April 11, 2020 06:40
dcherian added a commit to dcherian/xarray that referenced this pull request May 1, 2020
* upstream/master: (39 commits)
  Pint support for DataArray (pydata#3643)
  Apply blackdoc to the documentation (pydata#4012)
  ensure Variable._repr_html_ works (pydata#3973)
  Fix handling of abbreviated units like msec (pydata#3998)
  full_like: error on non-scalar fill_value (pydata#3979)
  Fix some code quality and bug-risk issues (pydata#3999)
  DOC: add pandas.DataFrame.to_xarray (pydata#3994)
  Better chunking error messages for zarr backend (pydata#3983)
  Silence sphinx warnings (pydata#3990)
  Fix distributed tests on upstream-dev (pydata#3989)
  Add multi-dimensional extrapolation example and mention different behavior of kwargs in interp (pydata#3956)
  keep attrs in interpolate_na (pydata#3970)
  actually use preformatted text in the details summary (pydata#3978)
  facetgrid: Ensure that colormap params are only determined once. (pydata#3915)
  RasterioDeprecationWarning (pydata#3964)
  Empty line missing for DataArray.assign_coords doc (pydata#3963)
  New coords to existing dim (doc) (pydata#3958)
  implement a more threadsafe call to colorbar (pydata#3944)
  Fix wrong order of coordinate converted from pd.series with MultiIndex (pydata#3953)
  Updated list of core developers (pydata#3943)
  ...
@snowman2
Copy link
Contributor

Would you like to add this update to rioxarray as well? If not, mind if I port it over?

@cheginit
Copy link
Contributor Author

@snowman2 Sure would be happy to.

@cheginit
Copy link
Contributor Author

@snowman2 I went through the code and didn't find any vrt related function. You used dst_nodata for reporjection which its corresponding rasterio API hasn't changed yet and still accepts dst_nodata. Is there any other part of your code that gives this warning?

@snowman2
Copy link
Contributor

cheginit added a commit to cheginit/rioxarray that referenced this pull request Jun 10, 2020
Following the discussion on [xarray](pydata/xarray#3964), this PR addresses the RasterioDeprecationWarning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants