From 1043a9e13574e859ec08d19425341b2e359d2802 Mon Sep 17 00:00:00 2001 From: JR Date: Thu, 31 Aug 2023 14:41:06 +0200 Subject: [PATCH] Document drop_variables in open_mfdataset (#8083) * Document drop_variables in open_mfdataset * Document open_mfdataset drop_variables option in example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Spelling --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tom Nicholas --- xarray/backends/api.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xarray/backends/api.py b/xarray/backends/api.py index e35d85a1e2f..7be7541a79b 100644 --- a/xarray/backends/api.py +++ b/xarray/backends/api.py @@ -930,7 +930,9 @@ def open_mfdataset( If a callable, it must expect a sequence of ``attrs`` dicts and a context object as its only parameters. **kwargs : optional - Additional arguments passed on to :py:func:`xarray.open_dataset`. + Additional arguments passed on to :py:func:`xarray.open_dataset`. For an + overview of some of the possible options, see the documentation of + :py:func:`xarray.open_dataset` Returns ------- @@ -965,6 +967,13 @@ def open_mfdataset( ... "file_*.nc", concat_dim="time", preprocess=partial_func ... ) # doctest: +SKIP + It is also possible to use any argument to ``open_dataset`` together + with ``open_mfdataset``, such as for example ``drop_variables``: + + >>> ds = xr.open_mfdataset( + ... "file.nc", drop_variables=["varname_1", "varname_2"] # any list of vars + ... ) # doctest: +SKIP + References ----------