From 6246a59ede90922540258076de319e7d79929e4f Mon Sep 17 00:00:00 2001 From: David Hoese Date: Mon, 4 May 2026 14:36:06 -0500 Subject: [PATCH] Fix various documentation errors and warnings --- docs/conf.py | 2 +- docs/getting_started/crs_management.ipynb | 10 +++++----- docs/history.rst | 2 +- docs/installation.rst | 1 + rioxarray/enum.py | 6 +++--- rioxarray/raster_array.py | 4 ++-- rioxarray/raster_dataset.py | 6 +++--- rioxarray/rioxarray.py | 2 +- 8 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index b4ba13f5..efe3790f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -75,7 +75,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff --git a/docs/getting_started/crs_management.ipynb b/docs/getting_started/crs_management.ipynb index 65b583be..51daa965 100644 --- a/docs/getting_started/crs_management.ipynb +++ b/docs/getting_started/crs_management.ipynb @@ -73,7 +73,7 @@ "data.rio.write_crs(\"EPSG:4326\", convention=Convention.CF, inplace=True)\n", "```\n", "\n", - "#### API Documentation\n", + "### API Documentation\n", "\n", "- [rioxarray.set_options](../rioxarray.rst#rioxarray.set_options)\n", "- [rioxarray.enum.Convention](../rioxarray.rst#rioxarray.enum.Convention)" @@ -92,7 +92,7 @@ "source": [ "If you have opened a dataset and the Coordinate Reference System (CRS) can be determined, you can access it via the `rio.crs` accessor.\n", "\n", - "#### Search order for the CRS (DataArray and Dataset):\n", + "### Search order for the CRS (DataArray and Dataset):\n", "1. Look in `encoding` of your data array for the `grid_mapping` coordinate name.\n", " Inside the `grid_mapping` coordinate first look for `spatial_ref` then `crs_wkt` and lastly the CF grid mapping attributes.\n", " This is in line with the Climate and Forecast (CF) conventions for storing the CRS as well as GDAL netCDF conventions.\n", @@ -100,17 +100,17 @@ "\n", "The value for the `crs` is anything accepted by `rasterio.crs.CRS.from_user_input()`\n", "\n", - "#### Search order for the CRS for Dataset:\n", + "### Search order for the CRS for Dataset:\n", "If the CRS is not found using the search methods above, it also searches the `data_vars` and uses the\n", "first valid CRS found.\n", "\n", - "#### decode_coords=\"all\"\n", + "### decode_coords=\"all\"\n", "\n", "If you use one of xarray's open methods such as ``xarray.open_dataset`` to load netCDF files\n", "with the default engine, it is recommended to use `decode_coords=\"all\"`. This will load the grid mapping\n", "variable into coordinates for compatibility with rioxarray.\n", "\n", - "#### API Documentation\n", + "### API Documentation\n", "\n", "- [rio.write_crs()](../rioxarray.rst#rioxarray.rioxarray.XRasterBase.write_crs)\n", "- [rio.crs](../rioxarray.rst#rioxarray.rioxarray.XRasterBase.crs)\n", diff --git a/docs/history.rst b/docs/history.rst index 5bf1af8a..c381976c 100644 --- a/docs/history.rst +++ b/docs/history.rst @@ -50,7 +50,7 @@ Unreleased - BUG:merge: Fix merging masked and scaled data (issue #814) - BUG: Fix chunk arguments for normalize_chunks (pull #820) - BUG: Squeeze when using interpolate_na with extra dim (pull #810) -* BUG: Properly handle encoding/decoding scales and offsets by (pull #821) +- BUG: Properly handle encoding/decoding scales and offsets by (pull #821) - DOC: Clearer coordinate docstring for `open_rasterio` (pull #811) 0.17.0 diff --git a/docs/installation.rst b/docs/installation.rst index 9f1de5fd..6917fe16 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -32,6 +32,7 @@ Stable release anaconda/miniconda. Using envs make it easier to debug problems with packages and ensure the stability of your root env." + -- https://conda-forge.org/docs/user/tipsandtricks.html .. warning:: diff --git a/rioxarray/enum.py b/rioxarray/enum.py index 93cb83e1..3248ab28 100644 --- a/rioxarray/enum.py +++ b/rioxarray/enum.py @@ -34,9 +34,9 @@ class Convention(Enum): References ---------- - .. [1] CF Conventions: https://github.com/cf-convention/cf-conventions - .. [2] Zarr spatial convention: https://github.com/zarr-conventions/spatial - .. [3] Zarr geo-proj convention: https://github.com/zarr-conventions/geo-proj + - CF Conventions: https://github.com/cf-convention/cf-conventions + - Zarr spatial convention: https://github.com/zarr-conventions/spatial + - Zarr geo-proj convention: https://github.com/zarr-conventions/geo-proj """ #: Climate and Forecasts convention (default) diff --git a/rioxarray/raster_array.py b/rioxarray/raster_array.py index fb17371d..c4d2d8c2 100644 --- a/rioxarray/raster_array.py +++ b/rioxarray/raster_array.py @@ -202,7 +202,7 @@ def reproject( resolution: Optional[Union[float, tuple[float, float]]] = None, shape: Optional[tuple[int, int]] = None, transform: Optional[Affine] = None, - resampling: Optional[Union[Resampling | str]] = Resampling.nearest, + resampling: Optional[Union[Resampling, str]] = Resampling.nearest, nodata: Optional[float] = None, **kwargs, ) -> xarray.DataArray: @@ -430,7 +430,7 @@ def reproject_match( self, match_data_array: Union[xarray.DataArray, xarray.Dataset], *, - resampling: Optional[Union[Resampling | str]] = Resampling.nearest, + resampling: Optional[Union[Resampling, str]] = Resampling.nearest, **reproject_kwargs, ) -> xarray.DataArray: """ diff --git a/rioxarray/raster_dataset.py b/rioxarray/raster_dataset.py index 560340c2..c3a536ed 100644 --- a/rioxarray/raster_dataset.py +++ b/rioxarray/raster_dataset.py @@ -25,7 +25,7 @@ class RasterDataset(XRasterBase): @property def vars(self) -> list: - """list: Returns non-coordinate varibles""" + """list: Returns non-coordinate variables.""" return list(self._obj.data_vars) @property @@ -63,7 +63,7 @@ def reproject( resolution: Optional[Union[float, tuple[float, float]]] = None, shape: Optional[tuple[int, int]] = None, transform: Optional[Affine] = None, - resampling: Optional[Union[Resampling | str]] = Resampling.nearest, + resampling: Optional[Union[Resampling, str]] = Resampling.nearest, nodata: Optional[float] = None, **kwargs, ) -> xarray.Dataset: @@ -145,7 +145,7 @@ def reproject_match( self, match_data_array: Union[xarray.DataArray, xarray.Dataset], *, - resampling: Optional[Union[Resampling | str]] = Resampling.nearest, + resampling: Optional[Union[Resampling, str]] = Resampling.nearest, **reproject_kwargs, ) -> xarray.Dataset: """ diff --git a/rioxarray/rioxarray.py b/rioxarray/rioxarray.py index 368d26a1..f3509a43 100644 --- a/rioxarray/rioxarray.py +++ b/rioxarray/rioxarray.py @@ -130,7 +130,7 @@ def set_crs( .. deprecated:: 0.15.8 It is recommended to use `rio.write_crs()` instead. This - method will likely be removed in a future release. + method will likely be removed in a future release. Parameters ----------