Skip to content

Commit 37f0147

Browse files
committed
Fix doctests
1 parent 0e678e5 commit 37f0147

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

xarray/core/combine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ def combine_by_coords(
878878
temperature (y, x) float64 96B 10.98 14.3 12.06 ... 1.743 0.4044 16.65
879879
precipitation (y, x) float64 96B 0.4376 0.8918 0.9637 ... 0.4615 0.7805
880880
881-
>>> xr.combine_by_coords([x3, x1])
881+
>>> xr.combine_by_coords([x3, x1], join="outer")
882882
<xarray.Dataset> Size: 464B
883883
Dimensions: (y: 4, x: 6)
884884
Coordinates:
@@ -898,7 +898,7 @@ def combine_by_coords(
898898
temperature (y, x) float64 96B 10.98 14.3 12.06 ... 18.89 10.44 8.293
899899
precipitation (y, x) float64 96B 0.4376 0.8918 0.9637 ... 0.01879 0.6176
900900
901-
>>> xr.combine_by_coords([x1, x2, x3])
901+
>>> xr.combine_by_coords([x1, x2, x3], join="outer")
902902
<xarray.Dataset> Size: 464B
903903
Dimensions: (y: 4, x: 6)
904904
Coordinates:

xarray/core/concat.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ def concat(
207207
* x (x) <U1 8B 'a' 'b'
208208
* y (y) int64 24B 10 20 30
209209
210-
>>> xr.concat([da.isel(x=0), da.isel(x=1)], "x")
210+
>>> xr.concat([da.isel(x=0), da.isel(x=1)], "x", coords="minimal")
211211
<xarray.DataArray (x: 2, y: 3)> Size: 48B
212212
array([[0, 1, 2],
213213
[3, 4, 5]])
214214
Coordinates:
215215
* x (x) <U1 8B 'a' 'b'
216216
* y (y) int64 24B 10 20 30
217217
218-
>>> xr.concat([da.isel(x=0), da.isel(x=1)], "new_dim")
218+
>>> xr.concat([da.isel(x=0), da.isel(x=1)], "new_dim", coords="all")
219219
<xarray.DataArray (new_dim: 2, y: 3)> Size: 48B
220220
array([[0, 1, 2],
221221
[3, 4, 5]])
@@ -224,7 +224,11 @@ def concat(
224224
* y (y) int64 24B 10 20 30
225225
Dimensions without coordinates: new_dim
226226
227-
>>> xr.concat([da.isel(x=0), da.isel(x=1)], pd.Index([-90, -100], name="new_dim"))
227+
>>> xr.concat(
228+
... [da.isel(x=0), da.isel(x=1)],
229+
... pd.Index([-90, -100], name="new_dim"),
230+
... coords="all",
231+
... )
228232
<xarray.DataArray (new_dim: 2, y: 3)> Size: 48B
229233
array([[0, 1, 2],
230234
[3, 4, 5]])

xarray/core/merge.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ def merge(
882882
* time (time) float64 16B 30.0 60.0
883883
* lon (lon) float64 16B 100.0 150.0
884884
885-
>>> xr.merge([x, y, z])
885+
>>> xr.merge([x, y, z], join="outer")
886886
<xarray.Dataset> Size: 256B
887887
Dimensions: (lat: 3, lon: 3, time: 2)
888888
Coordinates:
@@ -894,7 +894,7 @@ def merge(
894894
var2 (lat, lon) float64 72B 5.0 nan 6.0 nan nan nan 7.0 nan 8.0
895895
var3 (time, lon) float64 48B 0.0 nan 3.0 4.0 nan 9.0
896896
897-
>>> xr.merge([x, y, z], compat="identical")
897+
>>> xr.merge([x, y, z], compat="identical", join="outer")
898898
<xarray.Dataset> Size: 256B
899899
Dimensions: (lat: 3, lon: 3, time: 2)
900900
Coordinates:
@@ -906,7 +906,7 @@ def merge(
906906
var2 (lat, lon) float64 72B 5.0 nan 6.0 nan nan nan 7.0 nan 8.0
907907
var3 (time, lon) float64 48B 0.0 nan 3.0 4.0 nan 9.0
908908
909-
>>> xr.merge([x, y, z], compat="equals")
909+
>>> xr.merge([x, y, z], compat="equals", join="outer")
910910
<xarray.Dataset> Size: 256B
911911
Dimensions: (lat: 3, lon: 3, time: 2)
912912
Coordinates:
@@ -918,7 +918,7 @@ def merge(
918918
var2 (lat, lon) float64 72B 5.0 nan 6.0 nan nan nan 7.0 nan 8.0
919919
var3 (time, lon) float64 48B 0.0 nan 3.0 4.0 nan 9.0
920920
921-
>>> xr.merge([x, y, z], compat="equals", fill_value=-999.0)
921+
>>> xr.merge([x, y, z], compat="equals", join="outer", fill_value=-999.0)
922922
<xarray.Dataset> Size: 256B
923923
Dimensions: (lat: 3, lon: 3, time: 2)
924924
Coordinates:

0 commit comments

Comments
 (0)