Skip to content

Commit

Permalink
Fix Geotiff dataset docstring
Browse files Browse the repository at this point in the history
Signed-off-by: Merel Theisen <[email protected]>
  • Loading branch information
merelcht committed Feb 28, 2024
1 parent 2862893 commit 691f413
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions kedro-datasets/kedro_datasets/xarray/geotiff_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ class GeoTiffDataset(AbstractVersionedDataset[xarray.DataArray, xarray.DataArray
>>> import numpy as np
>>>
>>> data = xr.DataArray(
np.random.randn(2, 3, 2),
dims=("band", "y", "x"),
coords={"band": [1, 2], "y": [0.5, 1.5, 2.5], "x": [0.5, 1.5]},
)
>>> data = data.rio.write_crs("epsg:4326")
>>> data = data.rio.set_spatial_dims("x", "y")
... np.random.randn(2, 3, 2),
... dims=("band", "y", "x"),
... coords={"band": [1, 2], "y": [0.5, 1.5, 2.5], "x": [0.5, 1.5]}
... )
>>> data_crs = data.rio.write_crs("epsg:4326")
>>> data_spatial_dims = data_crs.rio.set_spatial_dims("x", "y")
>>> dataset = GeoTiffDataset(filepath="test.tif")
>>> dataset.save(data)
>>> dataset.save(data_spatial_dims)
>>> reloaded = dataset.load()
>>> xr.testing.assert_allclose(data, reloaded, rtol=1e-5)
>>> xr.testing.assert_allclose(data_spatial_dims, reloaded, rtol=1e-5)
"""

Expand Down

0 comments on commit 691f413

Please sign in to comment.