From 01f3b83926a48949146a45ce35bed82749981ace Mon Sep 17 00:00:00 2001
From: JoerivanEngelen Source code for xugrid.plot.plot
**kwargs : optional
Additional keyword arguments for Matplotlib.
"""
- darray = darray.squeeze().compute()
dim = darray.dims[0]
kwargs["ax"] = ax
@@ -1011,7 +1010,7 @@
Source code for xugrid.plot.plot
)
self.grid = grid
- self.darray = darray
+ self.darray = darray.squeeze().compute()
def __call__(self, **kwargs):
return plot(self.grid, self.darray, **kwargs)
diff --git a/_modules/xugrid/regrid/regridder.html b/_modules/xugrid/regrid/regridder.html
index 3b139e8e6..386ac4e11 100644
--- a/_modules/xugrid/regrid/regridder.html
+++ b/_modules/xugrid/regrid/regridder.html
@@ -392,10 +392,8 @@
Source code for xugrid.regrid.regridder
import dask.array
DaskArray = dask.array.Array
- DaskRechunk = dask.array.rechunk
except ImportError:
DaskArray = ()
- DaskRechunk = ()
import xugrid
from xugrid.constants import FloatArray
@@ -523,12 +521,8 @@
Source code for xugrid.regrid.regridder
source = source.reshape((-1, source_grid.size))
size = self._target.size
-
if isinstance(source, DaskArray):
- # for DaskArray's from multiple partitions, rechunk first to single size per dimension
- # for now always rechunk, could be optional only when explicit chunks in single dimension
- source = DaskRechunk(source, source.shape)
- chunks = source.chunks[: -source_grid.ndim] + (self._target.shape)
+ chunks = source.chunks[: -source_grid.ndim] + (self._target.shape,)
out = dask.array.map_blocks(
self._regrid, # func
source, # *args
@@ -538,9 +532,6 @@
Source code for xugrid.regrid.regridder
chunks=chunks,
meta=np.array((), dtype=source.dtype),
)
- # TODO: for now we compute first, since .reshape and dask.array.reshape
- # does not reshapes the underlying data somehow. This need to be evaluated.
- out = out.compute()
elif isinstance(source, np.ndarray):
out = self._regrid(source, self._weights, size)
else:
@@ -548,6 +539,7 @@
Source code for xugrid.regrid.regridder
"Expected dask.array.Array or numpy.ndarray. Received: "
f"{type(source).__name__}"
)
+
# E.g.: sizes of ("time", "layer") + ("y", "x")
out_shape = first_dims_shape + self._target.shape
return out.reshape(out_shape)
@@ -588,7 +580,12 @@
Source code for xugrid.regrid.regridder
if type(self._target) is StructuredGrid2d:
source_dims = ("y", "x")
regridded = self.regrid_dataarray(object, source_dims)
- regridded = regridded.assign_coords(coords=self._target.coords)
+ regridded = regridded.assign_coords(
+ coords={
+ "y": np.flip(self._target.ybounds.midpoints),
+ "x": self._target.xbounds.midpoints,
+ }
+ )
return regridded
else:
source_dims = (object.ugrid.grid.face_dimension,)
diff --git a/_sources/changelog.rst.txt b/_sources/changelog.rst.txt
index 2b17c1344..c88eae083 100644
--- a/_sources/changelog.rst.txt
+++ b/_sources/changelog.rst.txt
@@ -9,15 +9,21 @@ The format is based on `Keep a Changelog`_, and this project adheres to
Unreleased
----------
+Fixed
+~~~~~
+
+- Computing indexer to avoid dask array of unknown shape upon plotting.
+ See `#117
<xarray.DataArray 'elevation' (mesh2d_nFaces: 5248)>
array([False, False, False, ..., False, False, False])
Coordinates:
- * mesh2d_nFaces (mesh2d_nFaces) int64 0 1 2 3 4 ... 5243 5244 5245 5246 5247
array([False, False, False, ..., False, False, False])
array([ 0, 1, 2, ..., 5245, 5246, 5247])
PandasIndex(RangeIndex(start=0, stop=5248, step=1, name='mesh2d_nFaces'))
array([False, False, False, ..., False, False, False])
array([ 0, 1, 2, ..., 5245, 5246, 5247])
PandasIndex(RangeIndex(start=0, stop=5248, step=1, name='mesh2d_nFaces'))
@@ -1071,9 +1071,9 @@ reorder the data after merging.
Coordinates:
mesh2d_face_x (mesh2d_nFaces) float64 2.388e+04 1.86e+05 ... 3.03e+04
mesh2d_face_y (mesh2d_nFaces) float64 3.648e+05 4.171e+05 ... 3.964e+05
- * mesh2d_nFaces (mesh2d_nFaces) int64 0 1 2 3 4 ... 5243 5244 5245 5246 5247array([ True, True, True, ..., True, True, True])
array([ 23882.79376058, 186048.98609163, 183280.61324667, ...,
- 33842.56847139, 33139.63056206, 30303.5164253 ])
array([364821.96725663, 417102.96121876, 334623.01878379, ...,
- 397494.51640391, 400187.85011645, 396399.29036318])
array([ 0, 1, 2, ..., 5245, 5246, 5247])
PandasIndex(RangeIndex(start=0, stop=5248, step=1, name='mesh2d_nFaces'))
array([ True, True, True, ..., True, True, True])
array([ 23882.79376058, 186048.98609163, 183280.61324667, ...,
+ 33842.56847139, 33139.63056206, 30303.5164253 ])
array([364821.96725663, 417102.96121876, 334623.01878379, ...,
+ 397494.51640391, 400187.85011645, 396399.29036318])
array([ 0, 1, 2, ..., 5245, 5246, 5247])
PandasIndex(RangeIndex(start=0, stop=5248, step=1, name='mesh2d_nFaces'))
@@ -1090,7 +1090,7 @@ partitions.
.. rst-class:: sphx-glr-timing
- **Total running time of the script:** ( 0 minutes 5.430 seconds)
+ **Total running time of the script:** ( 0 minutes 6.102 seconds)
.. _sphx_glr_download_examples_partitioning.py:
diff --git a/_sources/examples/plotting.rst.txt b/_sources/examples/plotting.rst.txt
index b12f6bfa6..18e433359 100644
--- a/_sources/examples/plotting.rst.txt
+++ b/_sources/examples/plotting.rst.txt
@@ -451,12 +451,12 @@ faces.
Dimensions: (mesh2d_nNodes: 217, mesh2d_nFaces: 384, mesh2d_nEdges: 600)
Coordinates:
* mesh2d_nEdges (mesh2d_nEdges) int64 0 1 2 3 4 5 ... 594 595 596 597 598 599
- * mesh2d_nFaces (mesh2d_nFaces) int64 0 1 2 3 4 5 ... 378 379 380 381 382 383
* mesh2d_nNodes (mesh2d_nNodes) int64 0 1 2 3 4 5 ... 211 212 213 214 215 216
+ * mesh2d_nFaces (mesh2d_nFaces) int64 0 1 2 3 4 5 ... 378 379 380 381 382 383
Data variables:
node_z (mesh2d_nNodes) float64 1.933 2.091 1.875 ... 5.688 7.491
face_z (mesh2d_nFaces) float64 1.737 1.918 2.269 ... 5.408 6.424
- edge_z (mesh2d_nEdges) float64 1.989 1.875 1.8 ... 3.929 4.909 6.544array([ 0, 1, 2, ..., 597, 598, 599])
array([ 0, 1, 2, ..., 381, 382, 383])
array([ 0, 1, 2, ..., 214, 215, 216])
array([ 1.93329198, 2.09140061, 1.87484204, 1.71955236, 1.71961656,
+ edge_z (mesh2d_nEdges) float64 1.989 1.875 1.8 ... 3.929 4.909 6.544
array([ 0, 1, 2, ..., 597, 598, 599])
array([ 0, 1, 2, ..., 214, 215, 216])
array([ 0, 1, 2, ..., 381, 382, 383])
array([ 1.93329198, 2.09140061, 1.87484204, 1.71955236, 1.71961656,
1.87394091, 2.14519674, 2.30021006, 2.24185487, 2.02372336,
1.68192173, 1.51366054, 1.49636083, 1.42590672, 1.4384199 ,
1.61206453, 1.98452218, 2.34631843, 2.38859332, 2.67626878,
@@ -496,7 +496,7 @@ faces.
7.75144002, 7.88800553, 7.04359085, 5.35779319, 3.29726906,
1.5076096 , 0.54807376, 0.63361455, 1.53104833, 2.68784153,
3.53975332, 3.82702868, 3.73040836, 3.74099464, 4.34093488,
- 5.68812411, 7.49116681])
array([ 1.73730009, 1.91825084, 2.26876665, 5.31052091, 3.49842491,
+ 5.68812411, 7.49116681])
array([ 1.73730009, 1.91825084, 2.26876665, 5.31052091, 3.49842491,
4.88905017, 1.78990802, 2.0239473 , 4.2032856 , 3.82037735,
3.69611343, 2.34307619, 2.45189748, 2.05010445, 7.44429486,
7.02004231, 1.23173146, 1.24293922, 4.96369209, 5.46523899,
@@ -536,7 +536,7 @@ faces.
1.91611618, 0.93777886, 0.82127919, 0.82409913, 0.93548072,
0.94143233, 0.96785184, 5.94683372, 6.36476797, 4.85117403,
5.39410053, 4.05700573, 4.22359378, 5.59335232, 4.86883751,
- 7.30890722, 7.04320847, 5.40762661, 6.42392991])
array([ 1.98860502, 1.87511577, 1.7999506 , 1.81179977, 1.90641372,
+ 7.30890722, 7.04320847, 5.40762661, 6.42392991])
array([ 1.98860502, 1.87511577, 1.7999506 , 1.81179977, 1.90641372,
2.01522135, 1.95483397, 2.10396573, 2.1578564 , 2.07770379,
2.21438924, 1.76492656, 1.9903005 , 1.87706115, 1.74001569,
1.71509433, 1.64090366, 1.58755786, 1.5894138 , 1.77229325,
@@ -576,7 +576,7 @@ faces.
3.32923738, 4.69300073, 6.14800061, 7.35257773, 7.91736337,
7.55634316, 6.24399649, 4.29381546, 2.28970536, 0.86825983,
0.43934876, 0.99050549, 2.09805846, 3.16064474, 3.73547458,
- 3.7830263 , 3.6705139 , 3.92869759, 4.90866681, 6.54446841])
PandasIndex(RangeIndex(start=0, stop=600, step=1, name='mesh2d_nEdges'))
PandasIndex(RangeIndex(start=0, stop=384, step=1, name='mesh2d_nFaces'))
PandasIndex(RangeIndex(start=0, stop=217, step=1, name='mesh2d_nNodes'))
PandasIndex(RangeIndex(start=0, stop=600, step=1, name='mesh2d_nEdges'))
PandasIndex(RangeIndex(start=0, stop=217, step=1, name='mesh2d_nNodes'))
PandasIndex(RangeIndex(start=0, stop=384, step=1, name='mesh2d_nFaces'))
@@ -611,7 +611,7 @@ Dataset and calling the :py:meth:`UgridDataArray.ugrid.plot()` method.
.. code-block:: none
- array([ 0, 1, 2, ..., 9137, 9138, 9139])
array(['2000-01-01T00:00:00.000000000', '2000-01-01T00:30:00.000000000',
+ face_node_connectivity (face, nmax_face) float64 ...
array([ 0, 1, 2, ..., 9137, 9138, 9139])
array(['2000-01-01T00:00:00.000000000', '2000-01-01T00:30:00.000000000',
'2000-01-01T01:00:00.000000000', '2000-01-01T01:33:45.000000000',
'2000-01-01T02:03:45.000000000', '2000-01-01T02:33:45.000000000',
'2000-01-01T03:03:45.000000000', '2000-01-01T03:33:45.000000000',
@@ -488,10 +488,10 @@ We'll start by fetching a dataset:
'2000-01-01T21:02:30.000000000', '2000-01-01T21:32:30.000000000',
'2000-01-01T22:02:30.000000000', '2000-01-01T22:32:30.000000000',
'2000-01-01T23:02:30.000000000', '2000-01-01T23:32:30.000000000',
- '2000-01-02T00:00:00.000000000'], dtype='datetime64[ns]')
[9140 values with dtype=float64]
[9140 values with dtype=float64]
[9140 values with dtype=float64]
[447860 values with dtype=float64]
[1 values with dtype=int32]
[50607 values with dtype=float64]
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ '2000-01-02T00:00:00.000000000'], dtype='datetime64[ns]')
[9140 values with dtype=float64]
[9140 values with dtype=float64]
[9140 values with dtype=float64]
[447860 values with dtype=float64]
[1 values with dtype=int32]
[50607 values with dtype=float64]
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
...
9130, 9131, 9132, 9133, 9134, 9135, 9136, 9137, 9138, 9139],
- dtype='int64', name='node', length=9140))
PandasIndex(DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 00:30:00',
+ dtype='int64', name='node', length=9140))
PandasIndex(DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 00:30:00',
'2000-01-01 01:00:00', '2000-01-01 01:33:45',
'2000-01-01 02:03:45', '2000-01-01 02:33:45',
'2000-01-01 03:03:45', '2000-01-01 03:33:45',
@@ -516,7 +516,7 @@ We'll start by fetching a dataset:
'2000-01-01 22:02:30', '2000-01-01 22:32:30',
'2000-01-01 23:02:30', '2000-01-01 23:32:30',
'2000-01-02 00:00:00'],
- dtype='datetime64[ns]', name='time', freq=None))
@@ -919,7 +919,7 @@ separate the variables:
node_y (node) float64 ...
Data variables:
elevation (node) float64 ...
- depth (time, node) float64 ...array([ 0, 1, 2, ..., 9137, 9138, 9139])
array(['2000-01-01T00:00:00.000000000', '2000-01-01T00:30:00.000000000',
+ depth (time, node) float64 ...
array([ 0, 1, 2, ..., 9137, 9138, 9139])
array(['2000-01-01T00:00:00.000000000', '2000-01-01T00:30:00.000000000',
'2000-01-01T01:00:00.000000000', '2000-01-01T01:33:45.000000000',
'2000-01-01T02:03:45.000000000', '2000-01-01T02:33:45.000000000',
'2000-01-01T03:03:45.000000000', '2000-01-01T03:33:45.000000000',
@@ -943,7 +943,7 @@ separate the variables:
'2000-01-01T21:02:30.000000000', '2000-01-01T21:32:30.000000000',
'2000-01-01T22:02:30.000000000', '2000-01-01T22:32:30.000000000',
'2000-01-01T23:02:30.000000000', '2000-01-01T23:32:30.000000000',
- '2000-01-02T00:00:00.000000000'], dtype='datetime64[ns]')
[9140 values with dtype=float64]
[9140 values with dtype=float64]
[9140 values with dtype=float64]
[447860 values with dtype=float64]
PandasIndex(RangeIndex(start=0, stop=9140, step=1, name='node'))
PandasIndex(DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 00:30:00',
+ '2000-01-02T00:00:00.000000000'], dtype='datetime64[ns]')
[9140 values with dtype=float64]
[9140 values with dtype=float64]
[9140 values with dtype=float64]
[447860 values with dtype=float64]
PandasIndex(RangeIndex(start=0, stop=9140, step=1, name='node'))
PandasIndex(DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 00:30:00',
'2000-01-01 01:00:00', '2000-01-01 01:33:45',
'2000-01-01 02:03:45', '2000-01-01 02:33:45',
'2000-01-01 03:03:45', '2000-01-01 03:33:45',
@@ -968,7 +968,7 @@ separate the variables:
'2000-01-01 22:02:30', '2000-01-01 22:32:30',
'2000-01-01 23:02:30', '2000-01-01 23:32:30',
'2000-01-02 00:00:00'],
- dtype='datetime64[ns]', name='time', freq=None))
@@ -1361,7 +1361,7 @@ We can then grab one of the data variables as usual for xarray:
Coordinates:
* node (node) int64 0 1 2 3 4 5 6 7 ... 9133 9134 9135 9136 9137 9138 9139
node_x (node) float64 ...
- node_y (node) float64 ...[9140 values with dtype=float64]
array([ 0, 1, 2, ..., 9137, 9138, 9139])
[9140 values with dtype=float64]
[9140 values with dtype=float64]
PandasIndex(RangeIndex(start=0, stop=9140, step=1, name='node'))
[9140 values with dtype=float64]
array([ 0, 1, 2, ..., 9137, 9138, 9139])
[9140 values with dtype=float64]
[9140 values with dtype=float64]
PandasIndex(RangeIndex(start=0, stop=9140, step=1, name='node'))
@@ -1771,7 +1771,7 @@ some data by hand here:
<xarray.DataArray (mesh2d_nFaces: 2)>
array([1., 2.])
Coordinates:
- * mesh2d_nFaces (mesh2d_nFaces) int64 0 1
array([1., 2.])
array([0, 1])
PandasIndex(RangeIndex(start=0, stop=2, step=1, name='mesh2d_nFaces'))
array([1., 2.])
array([0, 1])
PandasIndex(RangeIndex(start=0, stop=2, step=1, name='mesh2d_nFaces'))
@@ -1809,7 +1809,7 @@ Plotting
.. code-block:: none
- <xarray.DataArray (mesh2d_nFaces: 2)>
array([11., 12.])
Coordinates:
- * mesh2d_nFaces (mesh2d_nFaces) int64 0 1
array([11., 12.])
array([0, 1])
PandasIndex(RangeIndex(start=0, stop=2, step=1, name='mesh2d_nFaces'))
array([11., 12.])
array([0, 1])
PandasIndex(RangeIndex(start=0, stop=2, step=1, name='mesh2d_nFaces'))
@@ -2720,7 +2720,7 @@ Conversion from Geopandas is easy too:
Coordinates:
* mesh2d_nFaces (mesh2d_nFaces) int64 0 1
Data variables:
- test (mesh2d_nFaces) float64 1.0 2.0array([0, 1])
array([1., 2.])
PandasIndex(RangeIndex(start=0, stop=2, step=1, name='mesh2d_nFaces'))
array([0, 1])
array([1., 2.])
PandasIndex(RangeIndex(start=0, stop=2, step=1, name='mesh2d_nFaces'))
@@ -3117,12 +3117,12 @@ grid (nodes, faces, edges).
Dimensions: (mesh2d_nNodes: 217, mesh2d_nFaces: 384, mesh2d_nEdges: 600)
Coordinates:
* mesh2d_nEdges (mesh2d_nEdges) int64 0 1 2 3 4 5 ... 594 595 596 597 598 599
- * mesh2d_nFaces (mesh2d_nFaces) int64 0 1 2 3 4 5 ... 378 379 380 381 382 383
* mesh2d_nNodes (mesh2d_nNodes) int64 0 1 2 3 4 5 ... 211 212 213 214 215 216
+ * mesh2d_nFaces (mesh2d_nFaces) int64 0 1 2 3 4 5 ... 378 379 380 381 382 383
Data variables:
node_z (mesh2d_nNodes) float64 1.933 2.091 1.875 ... 5.688 7.491
face_z (mesh2d_nFaces) float64 1.737 1.918 2.269 ... 5.408 6.424
- edge_z (mesh2d_nEdges) float64 1.989 1.875 1.8 ... 3.929 4.909 6.544array([ 0, 1, 2, ..., 597, 598, 599])
array([ 0, 1, 2, ..., 381, 382, 383])
array([ 0, 1, 2, ..., 214, 215, 216])
array([ 1.93329198, 2.09140061, 1.87484204, 1.71955236, 1.71961656,
+ edge_z (mesh2d_nEdges) float64 1.989 1.875 1.8 ... 3.929 4.909 6.544
array([ 0, 1, 2, ..., 597, 598, 599])
array([ 0, 1, 2, ..., 214, 215, 216])
array([ 0, 1, 2, ..., 381, 382, 383])
array([ 1.93329198, 2.09140061, 1.87484204, 1.71955236, 1.71961656,
1.87394091, 2.14519674, 2.30021006, 2.24185487, 2.02372336,
1.68192173, 1.51366054, 1.49636083, 1.42590672, 1.4384199 ,
1.61206453, 1.98452218, 2.34631843, 2.38859332, 2.67626878,
@@ -3162,7 +3162,7 @@ grid (nodes, faces, edges).
7.75144002, 7.88800553, 7.04359085, 5.35779319, 3.29726906,
1.5076096 , 0.54807376, 0.63361455, 1.53104833, 2.68784153,
3.53975332, 3.82702868, 3.73040836, 3.74099464, 4.34093488,
- 5.68812411, 7.49116681])
array([ 1.73730009, 1.91825084, 2.26876665, 5.31052091, 3.49842491,
+ 5.68812411, 7.49116681])
array([ 1.73730009, 1.91825084, 2.26876665, 5.31052091, 3.49842491,
4.88905017, 1.78990802, 2.0239473 , 4.2032856 , 3.82037735,
3.69611343, 2.34307619, 2.45189748, 2.05010445, 7.44429486,
7.02004231, 1.23173146, 1.24293922, 4.96369209, 5.46523899,
@@ -3202,7 +3202,7 @@ grid (nodes, faces, edges).
1.91611618, 0.93777886, 0.82127919, 0.82409913, 0.93548072,
0.94143233, 0.96785184, 5.94683372, 6.36476797, 4.85117403,
5.39410053, 4.05700573, 4.22359378, 5.59335232, 4.86883751,
- 7.30890722, 7.04320847, 5.40762661, 6.42392991])
array([ 1.98860502, 1.87511577, 1.7999506 , 1.81179977, 1.90641372,
+ 7.30890722, 7.04320847, 5.40762661, 6.42392991])
array([ 1.98860502, 1.87511577, 1.7999506 , 1.81179977, 1.90641372,
2.01522135, 1.95483397, 2.10396573, 2.1578564 , 2.07770379,
2.21438924, 1.76492656, 1.9903005 , 1.87706115, 1.74001569,
1.71509433, 1.64090366, 1.58755786, 1.5894138 , 1.77229325,
@@ -3242,7 +3242,7 @@ grid (nodes, faces, edges).
3.32923738, 4.69300073, 6.14800061, 7.35257773, 7.91736337,
7.55634316, 6.24399649, 4.29381546, 2.28970536, 0.86825983,
0.43934876, 0.99050549, 2.09805846, 3.16064474, 3.73547458,
- 3.7830263 , 3.6705139 , 3.92869759, 4.90866681, 6.54446841])
PandasIndex(RangeIndex(start=0, stop=600, step=1, name='mesh2d_nEdges'))
PandasIndex(RangeIndex(start=0, stop=384, step=1, name='mesh2d_nFaces'))
PandasIndex(RangeIndex(start=0, stop=217, step=1, name='mesh2d_nNodes'))
PandasIndex(RangeIndex(start=0, stop=600, step=1, name='mesh2d_nEdges'))
PandasIndex(RangeIndex(start=0, stop=217, step=1, name='mesh2d_nNodes'))
PandasIndex(RangeIndex(start=0, stop=384, step=1, name='mesh2d_nFaces'))
@@ -3634,7 +3634,7 @@ a grid object:
<xarray.Dataset>
Dimensions: ()
Data variables:
- *empty*
@@ -4029,7 +4029,7 @@ We can then add variables one-by-one, as we might with an xarray Dataset:
node_x (node) float64 ...
node_y (node) float64 ...
Data variables:
- elevation (node) float64 ...array([ 0, 1, 2, ..., 9137, 9138, 9139])
[9140 values with dtype=float64]
[9140 values with dtype=float64]
[9140 values with dtype=float64]
PandasIndex(RangeIndex(start=0, stop=9140, step=1, name='node'))
array([ 0, 1, 2, ..., 9137, 9138, 9139])
[9140 values with dtype=float64]
[9140 values with dtype=float64]
[9140 values with dtype=float64]
PandasIndex(RangeIndex(start=0, stop=9140, step=1, name='node'))
@@ -4434,7 +4434,7 @@ before writing.
elevation (node) float64 ...
depth (time, node) float64 ...
Attributes:
- Conventions: CF-1.8 UGRID-1.0[9140 values with dtype=float64]
[9140 values with dtype=float64]
array([ 0, 1, 2, ..., 9137, 9138, 9139])
array(['2000-01-01T00:00:00.000000000', '2000-01-01T00:30:00.000000000',
+ Conventions: CF-1.8 UGRID-1.0
[9140 values with dtype=float64]
[9140 values with dtype=float64]
array([ 0, 1, 2, ..., 9137, 9138, 9139])
array(['2000-01-01T00:00:00.000000000', '2000-01-01T00:30:00.000000000',
'2000-01-01T01:00:00.000000000', '2000-01-01T01:33:45.000000000',
'2000-01-01T02:03:45.000000000', '2000-01-01T02:33:45.000000000',
'2000-01-01T03:03:45.000000000', '2000-01-01T03:33:45.000000000',
@@ -4458,7 +4458,7 @@ before writing.
'2000-01-01T21:02:30.000000000', '2000-01-01T21:32:30.000000000',
'2000-01-01T22:02:30.000000000', '2000-01-01T22:32:30.000000000',
'2000-01-01T23:02:30.000000000', '2000-01-01T23:32:30.000000000',
- '2000-01-02T00:00:00.000000000'], dtype='datetime64[ns]')
[9140 values with dtype=float64]
[447860 values with dtype=float64]
PandasIndex(RangeIndex(start=0, stop=9140, step=1, name='node'))
PandasIndex(DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 00:30:00',
+ '2000-01-02T00:00:00.000000000'], dtype='datetime64[ns]')
[9140 values with dtype=float64]
[447860 values with dtype=float64]
PandasIndex(RangeIndex(start=0, stop=9140, step=1, name='node'))
PandasIndex(DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 00:30:00',
'2000-01-01 01:00:00', '2000-01-01 01:33:45',
'2000-01-01 02:03:45', '2000-01-01 02:33:45',
'2000-01-01 03:03:45', '2000-01-01 03:33:45',
@@ -4483,7 +4483,7 @@ before writing.
'2000-01-01 22:02:30', '2000-01-01 22:32:30',
'2000-01-01 23:02:30', '2000-01-01 23:32:30',
'2000-01-02 00:00:00'],
- dtype='datetime64[ns]', name='time', freq=None))
@@ -4495,7 +4495,7 @@ before writing.
.. rst-class:: sphx-glr-timing
- **Total running time of the script:** ( 0 minutes 0.739 seconds)
+ **Total running time of the script:** ( 0 minutes 0.882 seconds)
.. _sphx_glr_download_examples_quick_overview.py:
diff --git a/_sources/examples/regridder_overview.rst.txt b/_sources/examples/regridder_overview.rst.txt
index 1b9b96f3f..54791d81b 100644
--- a/_sources/examples/regridder_overview.rst.txt
+++ b/_sources/examples/regridder_overview.rst.txt
@@ -79,7 +79,7 @@ elevation of the Netherlands.
.. code-block:: none
- array([[ -8.83000004, -0.18999958, 44.04000092, ..., -9.72 ,
+ * layer (layer) int64 1 2 3 4 5
array([[ -8.83000004, -0.18999958, 44.04000092, ..., -9.72 ,
-25.82999992, -10.44999999],
[-18.83000004, -10.18999958, 34.04000092, ..., -19.72 ,
-35.82999992, -20.44999999],
@@ -720,7 +720,7 @@ result.
[-38.83000004, -30.18999958, 14.04000092, ..., -39.72 ,
-55.82999992, -40.44999999],
[-48.83000004, -40.18999958, 4.04000092, ..., -49.72 ,
- -65.82999992, -50.44999999]])
[5248 values with dtype=float64]
[5248 values with dtype=float64]
array([ 0, 1, 2, ..., 5245, 5246, 5247])
array([1, 2, 3, 4, 5])
PandasIndex(RangeIndex(start=0, stop=5248, step=1, name='mesh2d_nFaces'))
PandasIndex(Index([1, 2, 3, 4, 5], dtype='int64', name='layer'))
[5248 values with dtype=float64]
[5248 values with dtype=float64]
array([ 0, 1, 2, ..., 5245, 5246, 5247])
array([1, 2, 3, 4, 5])
PandasIndex(RangeIndex(start=0, stop=5248, step=1, name='mesh2d_nFaces'))
PandasIndex(Index([1, 2, 3, 4, 5], dtype='int64', name='layer'))
@@ -1153,7 +1153,7 @@ all additional dimensions.
-45.92794405, -39.50867478]])
Coordinates:
* layer (layer) int64 1 2 3 4 5
- * mesh2d_nFaces (mesh2d_nFaces) int64 0 1 2 3 4 5 6 ... 91 92 93 94 95 96 97array([[ 98.73378481, 24.75605825, nan, nan,
+ * mesh2d_nFaces (mesh2d_nFaces) int64 0 1 2 3 4 5 6 ... 91 92 93 94 95 96 97
array([[ 98.73378481, 24.75605825, nan, nan,
nan, nan, 28.6866454 , 21.59076039,
nan, nan, -10.30473318, -12.46283808,
nan, nan, 1.98885124, -0.45315257,
@@ -1193,12 +1193,12 @@ all additional dimensions.
-50.05098298, -50.91804551, -39.44818058, -44.02645019,
-34.95904013, -31.75848616, -53.71649682, -47.7613762 ,
-46.45744354, -42.33120932, -51.24098772, -50.25680056,
- -45.92794405, -39.50867478]])
array([1, 2, 3, 4, 5])
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
+ -45.92794405, -39.50867478]])
array([1, 2, 3, 4, 5])
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 94, 95, 96, 97])
PandasIndex(Index([1, 2, 3, 4, 5], dtype='int64', name='layer'))
PandasIndex(RangeIndex(start=0, stop=98, step=1, name='mesh2d_nFaces'))
PandasIndex(Index([1, 2, 3, 4, 5], dtype='int64', name='layer'))
PandasIndex(RangeIndex(start=0, stop=98, step=1, name='mesh2d_nFaces'))
@@ -1235,7 +1235,7 @@ and the aggregated mean.
.. code-block:: none
- [ChangelogSemantic Versioning.
Fillvalue was not properly replaced in cast. +See #113.
xugrid.Ugrid1d.contract_vertices()
has been added.
Regridding is possible again with regridders initiated from_weights
.
See #90.
@@ -656,10 +662,10 @@
xugrid.BarycentricInterpolator
,
xugrid.CentroidLocatorRegridder
, xugrid.OverlapRegridder
,
@@ -668,10 +674,10 @@
xugrid.Ugrid2d.tesselate_centroidal_voronoi()
and
xugrid.Ugrid2d.tesselate_circumcenter_voronoi()
will only include
@@ -683,8 +689,8 @@
geopandas
was missing in the environment.xugrid.Ugrid2d.sel_points()
and
xugrid.UgridDataArrayAccessor.sel_points()
now return a result with an
@@ -697,8 +703,8 @@
xugrid.Ugrid2d.tesselate_circumcenter_voronoi()
has been added to
provide orthogonal voronoi cells for triangular grids.
pygeos
has been replaced by shapely >= 2.0
.
xugrid.snap_to_grid()
will now return a UgridDataset and a geopandas
@@ -738,18 +744,18 @@
xugrid.Ugrid2d.tesselate_circumcenter_voronoi()
has been added to
provide orthogonal voronoi cells for triangular grids.
xugrid.open_dataarray()
will now return xugrid.UgridDataArray
instead of only an xarray DataArray without topology.
Several regridding methods have been added for face associated data:
xugrid.BarycentricInterpolator
have been added to interpolate
@@ -776,10 +782,10 @@
xugrid.Ugrid1d.topology_subset()
,
xugrid.Ugrid2d.topology_subset()
, and therefore also
@@ -801,8 +807,8 @@
Forwarding to the internal xarray object is now setup at class definition of
UgridDataArray
and UgridDataset
rather than at runtime.
@@ -828,8 +834,8 @@
xugrid.Ugrid1d
and xugrid.Ugrid2d
can now be initialized
with an attrs
argument to setup non-default UGRID attributes such as
@@ -849,28 +855,28 @@
Move matplotlib import into a function body so matplotlib remains an optional dependency.
Warn instead of error when the UGRID attributes indicate a set of coordinate that are not present in the dataset.
Use pyproject.toml for setuptools instead of setup.cfg.
xugrid.Ugrid1d.edge_bounds
has been added to get the bounds
for every edge contained in the grid.
xugrid.UgridDataArray.from_structured()
will no longer result in
a flipped grid when the structured coordintes are not ascending.
The setitem method of xugrid.UgridDataset
has been updated to check
the dimensions of grids rather than the dimensions of objects to decide
@@ -913,25 +919,25 @@
list
and dict
type annotations have been replaced with List
and Dict
from the typing module to support older versions of Python (<3.9).
The inplace
argument has been removed from xugrid.Ugrid1d.to_crs()
and xugrid.Ugrid2d.to_crs()
; A copy is returned when the CRS is already
as requested.
xugrid.UgridDataArrayAccessor.set_crs()
has been added to set the CRS.
xugrid.UgridDataArrayAccessor.to_crs()
has been added to reproject the
@@ -950,18 +956,18 @@
A start_index
of 1 in connectivity arrays is handled and will no longer
result in indexing errors.
levels
argument is now respected in line and pcolormesh plotting methods.
UGRID variables are now extracted via xugrid.UgridRolesAccessor
to
allow for multiple UGRID topologies in a single dataset.
xugrid.UgridRolesAccessor
has been added to extract UGRID variables
from xarray Datasets.
00:01.786 total execution time for examples-dev files:
+00:01.929 total execution time for examples-dev files: