@@ -216,8 +216,8 @@ def _combine_1d(datasets, concat_dim, compat='no_conflicts', data_vars='all',
216
216
except ValueError as err :
217
217
if "encountered unexpected variable" in str (err ):
218
218
raise ValueError ("These objects cannot be combined using only "
219
- "xarray.combine_manual , instead either use "
220
- "xarray.combine_auto , or do it manually "
219
+ "xarray.combine_nested , instead either use "
220
+ "xarray.combine_by_coords , or do it manually "
221
221
"with xarray.concat, xarray.merge and "
222
222
"xarray.align" )
223
223
else :
@@ -233,7 +233,7 @@ def _new_tile_id(single_id_ds_pair):
233
233
return tile_id [1 :]
234
234
235
235
236
- def _manual_combine (datasets , concat_dims , compat , data_vars , coords , ids ,
236
+ def _nested_combine (datasets , concat_dims , compat , data_vars , coords , ids ,
237
237
fill_value = dtypes .NA ):
238
238
239
239
if len (datasets ) == 0 :
@@ -259,7 +259,7 @@ def _manual_combine(datasets, concat_dims, compat, data_vars, coords, ids,
259
259
return combined
260
260
261
261
262
- def combine_manual (datasets , concat_dim , compat = 'no_conflicts' ,
262
+ def combine_nested (datasets , concat_dim , compat = 'no_conflicts' ,
263
263
data_vars = 'all' , coords = 'different' , fill_value = dtypes .NA ):
264
264
"""
265
265
Explicitly combine an N-dimensional grid of datasets into one by using a
@@ -335,7 +335,7 @@ def combine_manual(datasets, concat_dim, compat='no_conflicts',
335
335
precipitation (x, y) float64 5.904 2.453 3.404 ...
336
336
337
337
>>> ds_grid = [[x1y1, x1y2], [x2y1, x2y2]]
338
- >>> combined = xr.combine_manual (ds_grid, concat_dim=['x', 'y'])
338
+ >>> combined = xr.combine_nested (ds_grid, concat_dim=['x', 'y'])
339
339
<xarray.Dataset>
340
340
Dimensions: (x: 4, y: 4)
341
341
Dimensions without coordinates: x, y
@@ -364,7 +364,7 @@ def combine_manual(datasets, concat_dim, compat='no_conflicts',
364
364
precipitation (t) float64 5.904 2.453 3.404 ...
365
365
366
366
>>> ds_grid = [[t1temp, t1precip], [t2temp, t2precip]]
367
- >>> combined = xr.combine_manual (ds_grid, concat_dim=['t', None])
367
+ >>> combined = xr.combine_nested (ds_grid, concat_dim=['t', None])
368
368
<xarray.Dataset>
369
369
Dimensions: (t: 10)
370
370
Dimensions without coordinates: t
@@ -382,7 +382,7 @@ def combine_manual(datasets, concat_dim, compat='no_conflicts',
382
382
concat_dim = [concat_dim ]
383
383
384
384
# The IDs argument tells _manual_combine that datasets aren't yet sorted
385
- return _manual_combine (datasets , concat_dims = concat_dim , compat = compat ,
385
+ return _nested_combine (datasets , concat_dims = concat_dim , compat = compat ,
386
386
data_vars = data_vars , coords = coords , ids = False ,
387
387
fill_value = fill_value )
388
388
@@ -391,8 +391,8 @@ def vars_as_keys(ds):
391
391
return tuple (sorted (ds ))
392
392
393
393
394
- def combine_auto (datasets , compat = 'no_conflicts' , data_vars = 'all' ,
395
- coords = 'different' , fill_value = dtypes .NA ):
394
+ def combine_by_coords (datasets , compat = 'no_conflicts' , data_vars = 'all' ,
395
+ coords = 'different' , fill_value = dtypes .NA ):
396
396
"""
397
397
Attempt to auto-magically combine the given datasets into one by using
398
398
dimension coordinates.
@@ -449,14 +449,14 @@ def combine_auto(datasets, compat='no_conflicts', data_vars='all',
449
449
--------
450
450
concat
451
451
merge
452
- combine_manual
452
+ combine_nested
453
453
454
454
Examples
455
455
--------
456
456
457
457
Combining two datasets using their common dimension coordinates. Notice
458
458
they are concatenated based on the values in their dimension coordinates,
459
- not on their position in the list passed to `combine_auto `.
459
+ not on their position in the list passed to `combine_by_coords `.
460
460
461
461
>>> x1
462
462
<xarray.Dataset>
@@ -474,7 +474,7 @@ def combine_auto(datasets, compat='no_conflicts', data_vars='all',
474
474
Data variables:
475
475
temperature (x) float64 6.97 8.13 7.42 ...
476
476
477
- >>> combined = xr.combine_auto ([x2, x1])
477
+ >>> combined = xr.combine_by_coords ([x2, x1])
478
478
<xarray.Dataset>
479
479
Dimensions: (x: 6)
480
480
Coords:
@@ -528,8 +528,8 @@ def auto_combine(datasets, concat_dim='_not_supplied', compat='no_conflicts',
528
528
"""
529
529
Attempt to auto-magically combine the given datasets into one.
530
530
531
- This entire function is deprecated in favour of ``combine_manual `` and
532
- ``combine_auto ``.
531
+ This entire function is deprecated in favour of ``combine_nested `` and
532
+ ``combine_by_coords ``.
533
533
534
534
This method attempts to combine a list of datasets into a single entity by
535
535
inspecting metadata and using a combination of concat and merge.
@@ -593,34 +593,35 @@ def auto_combine(datasets, concat_dim='_not_supplied', compat='no_conflicts',
593
593
message = dedent ("""\
594
594
Also `open_mfdataset` will no longer accept a `concat_dim` argument.
595
595
To get equivalent behaviour from now on please use the new
596
- `combine_manual ` function instead (or the `combine='manual '` option to
596
+ `combine_nested ` function instead (or the `combine='nested '` option to
597
597
`open_mfdataset`).""" )
598
598
599
599
if _dimension_coords_exist (datasets ):
600
600
message += dedent ("""\
601
601
The datasets supplied have global dimension coordinates. You may want
602
- to use the new `combine_auto` function (or the `combine='auto'` option
603
- to `open_mfdataset` to order the datasets before concatenation.
604
- Alternatively, to continue concatenating based on the order the
605
- datasets are supplied in in future, please use the new `combine_manual`
606
- function (or the `combine='manual'` option to open_mfdataset).""" )
602
+ to use the new `combine_by_coords` function (or the
603
+ `combine='by_coords'` option to `open_mfdataset` to order the datasets
604
+ before concatenation. Alternatively, to continue concatenating based
605
+ on the order the datasets are supplied in in future, please use the
606
+ new `combine_nested` function (or the `combine='nested'` option to
607
+ open_mfdataset).""" )
607
608
else :
608
609
message += dedent ("""\
609
610
The datasets supplied do not have global dimension coordinates. In
610
611
future, to continue concatenating without supplying dimension
611
- coordinates, please use the new `combine_manual ` function (or the
612
- `combine='manual '` option to open_mfdataset.""" )
612
+ coordinates, please use the new `combine_nested ` function (or the
613
+ `combine='nested '` option to open_mfdataset.""" )
613
614
614
615
if _requires_concat_and_merge (datasets ):
615
616
manual_dims = [concat_dim ].append (None )
616
617
message += dedent ("""\
617
618
The datasets supplied require both concatenation and merging. From
618
619
xarray version 0.14 this will operation will require either using the
619
- new `combine_manual ` function (or the `combine='manual '` option to
620
+ new `combine_nested ` function (or the `combine='nested '` option to
620
621
open_mfdataset), with a nested list structure such that you can combine
621
622
along the dimensions {}. Alternatively if your datasets have global
622
- dimension coordinates then you can use the new `combine_auto` function.
623
- """ .format (manual_dims ))
623
+ dimension coordinates then you can use the new `combine_by_coords`
624
+ function. """ .format (manual_dims ))
624
625
625
626
warnings .warn (message , FutureWarning , stacklevel = 2 )
626
627
0 commit comments