From 0e3089c12ddc32eeed26f5c1bfebb36447146659 Mon Sep 17 00:00:00 2001 From: Spencer Jones <41342785+cspencerjones@users.noreply.github.com> Date: Fri, 23 Aug 2019 10:00:39 -0700 Subject: [PATCH 1/3] Updater to testing environment name (#3253) The testing environment name has been updated to `xarray-tests` in the package and we should do this in the documentation as well. --- doc/contributing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/contributing.rst b/doc/contributing.rst index 429c282a95f..9017c3dde7c 100644 --- a/doc/contributing.rst +++ b/doc/contributing.rst @@ -152,10 +152,10 @@ We'll now kick off a two-step process: # Create and activate the build environment conda env create -f ci/requirements/py36.yml - conda activate test_env + conda activate xarray-tests # or with older versions of Anaconda: - source activate test_env + source activate xarray-tests # Build and install xarray pip install -e . From 732cf9afb434caeec34a29e91144da4783b6a670 Mon Sep 17 00:00:00 2001 From: Siyu Yang Date: Thu, 12 Sep 2019 19:07:10 -0700 Subject: [PATCH 2/3] Update why-xarray.rst with clearer expression (#3307) in one sentence. --- doc/why-xarray.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/why-xarray.rst b/doc/why-xarray.rst index d0a6c591b29..25d558d99d5 100644 --- a/doc/why-xarray.rst +++ b/doc/why-xarray.rst @@ -62,9 +62,8 @@ The power of the dataset over a plain dictionary is that, in addition to pulling out arrays by name, it is possible to select or combine data along a dimension across all arrays simultaneously. Like a :py:class:`~pandas.DataFrame`, datasets facilitate array operations with -heterogeneous data -- the difference is that the arrays in a dataset can not -only have different data types, but can also have different numbers of -dimensions. +heterogeneous data -- the difference is that the arrays in a dataset can have +not only different data types, but also different numbers of dimensions. This data model is borrowed from the netCDF_ file format, which also provides xarray with a natural and portable serialization format. NetCDF is very popular From e90e8bc06cf8e7c97c7dc4c0e8ff1bf87c49faf6 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Fri, 13 Sep 2019 15:39:40 +0000 Subject: [PATCH 3/3] ignore h5py 2.10.0 warnings and fix invalid_netcdf warning test. (#3301) * ignore h5py 2.10.0 warnings and fix invalid_netcdf warning test. * Better fix. * fix fix. * remove comment. * Add docs. * Revert "Add docs." This reverts commit 14ae0b1153f56144c7a90966512f0a156355cf25. --- xarray/tests/test_backends.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index a5c42fd368c..f6254b32f4f 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -2163,6 +2163,7 @@ def test_encoding_unlimited_dims(self): @requires_h5netcdf @requires_netCDF4 +@pytest.mark.filterwarnings("ignore:use make_scale(name) instead") class TestH5NetCDFData(NetCDF4Base): engine = "h5netcdf" @@ -2173,16 +2174,25 @@ def create_store(self): @pytest.mark.filterwarnings("ignore:complex dtypes are supported by h5py") @pytest.mark.parametrize( - "invalid_netcdf, warns, num_warns", + "invalid_netcdf, warntype, num_warns", [(None, FutureWarning, 1), (False, FutureWarning, 1), (True, None, 0)], ) - def test_complex(self, invalid_netcdf, warns, num_warns): + def test_complex(self, invalid_netcdf, warntype, num_warns): expected = Dataset({"x": ("y", np.ones(5) + 1j * np.ones(5))}) save_kwargs = {"invalid_netcdf": invalid_netcdf} - with pytest.warns(warns) as record: + with pytest.warns(warntype) as record: with self.roundtrip(expected, save_kwargs=save_kwargs) as actual: assert_equal(expected, actual) - assert len(record) == num_warns + + recorded_num_warns = 0 + if warntype: + for warning in record: + if issubclass(warning.category, warntype) and ( + "complex dtypes" in str(warning.message) + ): + recorded_num_warns += 1 + + assert recorded_num_warns == num_warns def test_cross_engine_read_write_netcdf4(self): # Drop dim3, because its labels include strings. These appear to be @@ -2451,6 +2461,7 @@ def skip_if_not_engine(engine): @requires_dask +@pytest.mark.filterwarnings("ignore:use make_scale(name) instead") def test_open_mfdataset_manyfiles( readengine, nfiles, parallel, chunks, file_cache_maxsize ):