From 2f94e41efdff4abcc670c76a8a8b2dbe38eb84ca Mon Sep 17 00:00:00 2001 From: Thomas Nicholas Date: Fri, 14 Dec 2018 11:23:52 +0000 Subject: [PATCH 1/4] Arguments for open_mfdataset() now match signature in xarray master branch --- xbout/load.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xbout/load.py b/xbout/load.py index 3f3a58bd..7f914308 100644 --- a/xbout/load.py +++ b/xbout/load.py @@ -19,10 +19,9 @@ def _auto_open_mfboutdataset(datapath, chunks={}, info=True, keep_guards=True): _preprocess = partial(_trim, ghosts={'x': mxg, 'y': myg}) - ds = xarray.open_mfdataset(paths_grid, concat_dims=concat_dims, + ds = xarray.open_mfdataset(paths_grid, concat_dim=concat_dims, data_vars='minimal', preprocess=_preprocess, - engine=filetype, chunks=chunks, - infer_order_from_coords=False) + engine=filetype, chunks=chunks) ds, metadata = _strip_metadata(ds) From 5884143a54cfedcc5945a1286f8e5cbe68ed72f7 Mon Sep 17 00:00:00 2001 From: Thomas Nicholas Date: Tue, 2 Jul 2019 09:52:25 +0100 Subject: [PATCH 2/4] Updated to match xarray v0.12.2 onwards --- xbout/load.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xbout/load.py b/xbout/load.py index 7f914308..bc8e78b6 100644 --- a/xbout/load.py +++ b/xbout/load.py @@ -20,8 +20,9 @@ def _auto_open_mfboutdataset(datapath, chunks={}, info=True, keep_guards=True): _preprocess = partial(_trim, ghosts={'x': mxg, 'y': myg}) ds = xarray.open_mfdataset(paths_grid, concat_dim=concat_dims, - data_vars='minimal', preprocess=_preprocess, - engine=filetype, chunks=chunks) + combine='nested', data_vars='minimal', + preprocess=_preprocess, engine=filetype, + chunks=chunks) ds, metadata = _strip_metadata(ds) From dec228c9d798fddf546592fa9107ecc494d2f6b5 Mon Sep 17 00:00:00 2001 From: Thomas Nicholas Date: Tue, 2 Jul 2019 09:59:50 +0100 Subject: [PATCH 3/4] Updated requirements --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e0a9ca3d..2df45747 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -git+https://github.com/TomNicholas/xarray@feature/nd_combine#egg=xarray +xarray >= 0.12.2 dask[array] >= 1.0.0 natsort >= 5.5.0 matplotlib >= 2.2 From 766c5b09c0cdcf3f52f9372936a97886d0cda5b5 Mon Sep 17 00:00:00 2001 From: Thomas Nicholas Date: Tue, 2 Jul 2019 10:00:15 +0100 Subject: [PATCH 4/4] Updated readme to describe dependencies correctly --- README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index ae99e6e0..8ba65879 100644 --- a/README.md +++ b/README.md @@ -101,13 +101,7 @@ install using `python setup.py` You can run the tests by navigating to the `/xBOUT/` directory and entering `pytest`. - -It relies on two upstream additions to xarray -([first](https://github.com/pydata/xarray/pull/2482) & -[second](https://github.com/pydata/xarray/pull/2553) pull requests). -The first is merged, but the second isn't, so for now you need to clone -the branch of xarray containing the PR -[here](https://github.com/TomNicholas/xarray/tree/feature/nd_combine). +Requires xarray v0.12.2 or later. You will also need to install [dask](https://dask.org/), as described in the xarray documentation