Hello community, here is the log from the commit of package python-xarray for openSUSE:Factory checked in at 2019-02-14 14:35:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-xarray (Old) and /work/SRC/openSUSE:Factory/.python-xarray.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-xarray" Thu Feb 14 14:35:46 2019 rev:8 rq:674708 version:0.11.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-xarray/python-xarray.changes 2019-01-24 14:14:42.687272610 +0100 +++ /work/SRC/openSUSE:Factory/.python-xarray.new.28833/python-xarray.changes 2019-02-14 14:36:07.351577456 +0100 @@ -1,0 +2,10 @@ +Wed Feb 13 18:04:03 UTC 2019 - Todd R <[email protected]> + +- update to version 0.11.3 + * Saving files with times encoded with reference dates with timezones + (e.g. '2000-01-01T00:00:00-05:00') no longer raises an error + * Fixed performance regression with ``open_mfdataset`` + * Fixed supplying an explicit dimension in the ``concat_dim`` argument to + to ``open_mfdataset`` + +------------------------------------------------------------------- Old: ---- xarray-0.11.2.tar.gz New: ---- xarray-0.11.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-xarray.spec ++++++ --- /var/tmp/diff_new_pack.K9msWe/_old 2019-02-14 14:36:08.767576817 +0100 +++ /var/tmp/diff_new_pack.K9msWe/_new 2019-02-14 14:36:08.771576815 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-xarray -Version: 0.11.2 +Version: 0.11.3 Release: 0 Summary: N-D labeled arrays and datasets in Python License: Apache-2.0 ++++++ xarray-0.11.2.tar.gz -> xarray-0.11.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/PKG-INFO new/xarray-0.11.3/PKG-INFO --- old/xarray-0.11.2/PKG-INFO 2019-01-03 02:56:03.000000000 +0100 +++ new/xarray-0.11.3/PKG-INFO 2019-01-26 23:11:45.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: xarray -Version: 0.11.2 +Version: 0.11.3 Summary: N-D labeled arrays and datasets in Python Home-page: https://github.com/pydata/xarray Author: xarray Developers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/doc/environment.yml new/xarray-0.11.3/doc/environment.yml --- old/xarray-0.11.2/doc/environment.yml 2018-12-30 03:26:14.000000000 +0100 +++ new/xarray-0.11.3/doc/environment.yml 2019-01-26 19:20:41.000000000 +0100 @@ -2,22 +2,25 @@ channels: - conda-forge dependencies: - - python=3.6 - - numpy=1.14.5 + - python=3.7 + - numpy=1.16.0 - pandas=0.23.3 - - scipy=1.1.0 - - matplotlib=2.2.2 + - scipy=1.2.0 + - matplotlib=3.0.2 - seaborn=0.9.0 - - dask=0.18.2 - - ipython=6.4.0 - - netCDF4=1.4.0 - - cartopy=0.16.0 - - rasterio=1.0.1 + - dask=1.1.0 + - ipython=7.2.0 + - netCDF4=1.4.2 + - cartopy=0.17.0 + - rasterio=1.0.13 - zarr=2.2.0 - - iris=2.1.0 - - flake8=3.5.0 + - iris=2.2.0 + - flake8=3.6.0 - cftime=1.0.3.4 - - bottleneck=1.2 - - sphinx=1.7.6 + - bottleneck=1.2.1 + - sphinx=1.8.2 - numpydoc=0.8.0 - sphinx-gallery=0.2.0 + - pillow=5.4.1 + - sphinx_rtd_theme=0.4.2 + - mock=2.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/doc/examples/multidimensional-coords.rst new/xarray-0.11.3/doc/examples/multidimensional-coords.rst --- old/xarray-0.11.2/doc/examples/multidimensional-coords.rst 2018-12-30 03:26:14.000000000 +0100 +++ new/xarray-0.11.3/doc/examples/multidimensional-coords.rst 2019-01-26 19:20:41.000000000 +0100 @@ -78,9 +78,8 @@ ax = plt.axes(projection=ccrs.PlateCarree()); ds.Tair[0].plot.pcolormesh(ax=ax, transform=ccrs.PlateCarree(), x='xc', y='yc', add_colorbar=False); - ax.coastlines(); @savefig xarray_multidimensional_coords_12_0.png width=100% - plt.tight_layout(); + ax.coastlines(); Multidimensional Groupby ------------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/doc/pandas.rst new/xarray-0.11.3/doc/pandas.rst --- old/xarray-0.11.2/doc/pandas.rst 2018-12-30 03:26:14.000000000 +0100 +++ new/xarray-0.11.3/doc/pandas.rst 2019-01-26 19:20:41.000000000 +0100 @@ -14,7 +14,7 @@ __ http://stanford.edu/~mwaskom/software/seaborn/ .. ipython:: python - :suppress: + :suppress: import numpy as np import pandas as pd @@ -93,7 +93,6 @@ s = ds['foo'].to_series() s - # or equivalently, with Series.to_xarray() xr.DataArray.from_series(s) @@ -173,11 +172,10 @@ Let's take a look: .. ipython:: python - :okwarning: + :okwarning: panel = pd.Panel(np.random.rand(2, 3, 4), items=list('ab'), major_axis=list('mno'), minor_axis=pd.date_range(start='2000', periods=4, name='date')) - panel As a DataArray: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/doc/time-series.rst new/xarray-0.11.3/doc/time-series.rst --- old/xarray-0.11.2/doc/time-series.rst 2018-12-30 03:26:14.000000000 +0100 +++ new/xarray-0.11.3/doc/time-series.rst 2019-01-26 19:20:41.000000000 +0100 @@ -15,7 +15,6 @@ import numpy as np import pandas as pd import xarray as xr - np.random.seed(123456) Creating datetime64 data @@ -241,7 +240,6 @@ from itertools import product from cftime import DatetimeNoLeap - dates = [DatetimeNoLeap(year, month, 1) for year, month in product(range(1, 3), range(1, 13))] da = xr.DataArray(np.arange(24), coords=[dates], dims=['time'], name='foo') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/doc/whats-new.rst new/xarray-0.11.3/doc/whats-new.rst --- old/xarray-0.11.2/doc/whats-new.rst 2019-01-03 02:54:17.000000000 +0100 +++ new/xarray-0.11.3/doc/whats-new.rst 2019-01-26 19:21:11.000000000 +0100 @@ -13,6 +13,23 @@ import xarray as xr np.random.seed(123456) +.. _whats-new.0.11.3: + +v0.11.3 (26 January 2019) +------------------------- + +Bug fixes +~~~~~~~~~ + +- Saving files with times encoded with reference dates with timezones + (e.g. '2000-01-01T00:00:00-05:00') no longer raises an error + (:issue:`2649`). By `Spencer Clark <https://github.com/spencerkclark>`_. +- Fixed performance regression with ``open_mfdataset`` (:issue:`2662`). + By `Tom Nicholas <http://github.com/TomNicholas>`_. +- Fixed supplying an explicit dimension in the ``concat_dim`` argument to + to ``open_mfdataset`` (:issue:`2647`). + By `Ben Root <https://github.com/WeatherGod>`_. + .. _whats-new.0.11.2: v0.11.2 (2 January 2019) @@ -21,15 +38,6 @@ Removes inadvertently introduced setup dependency on pytest-runner (:issue:`2641`). Otherwise, this release is exactly equivalent to 0.11.1. -.. warning:: - - This is the last xarray release that will support Python 2.7. Future releases - will be Python 3 only, but older versions of xarray will always be available - for Python 2.7 users. For the more details, see: - - - `Xarray Github issue discussing dropping Python 2 <https://github.com/pydata/xarray/issues/1829>`__ - - `Python 3 Statement <http://www.python3statement.org/>`__ - - `Tips on porting to Python 3 <https://docs.python.org/3/howto/pyporting.html>`__ .. _whats-new.0.11.1: @@ -114,6 +122,16 @@ v0.11.0 (7 November 2018) ------------------------- +.. warning:: + + This is the last major release that will support Python 2.7. Future releases + will be Python 3 only, but older versions of xarray will always be available + for Python 2.7 users. For the more details, see: + + - `Xarray Github issue discussing dropping Python 2 <https://github.com/pydata/xarray/issues/1829>`__ + - `Python 3 Statement <http://www.python3statement.org/>`__ + - `Tips on porting to Python 3 <https://docs.python.org/3/howto/pyporting.html>`__ + Breaking changes ~~~~~~~~~~~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/xarray/_version.py new/xarray-0.11.3/xarray/_version.py --- old/xarray-0.11.2/xarray/_version.py 2019-01-03 02:56:03.000000000 +0100 +++ new/xarray-0.11.3/xarray/_version.py 2019-01-26 23:11:45.000000000 +0100 @@ -8,11 +8,11 @@ version_json = ''' { - "date": "2019-01-02T17:54:59-0800", + "date": "2019-01-26T10:21:20-0800", "dirty": false, "error": null, - "full-revisionid": "624d78f48cfa54b8952219ecf37bcee4673da900", - "version": "0.11.2" + "full-revisionid": "d58e0769c7d600d5c8c3c2fb52aa28856c4d3290", + "version": "0.11.3" } ''' # END VERSION_JSON diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/xarray/backends/api.py new/xarray-0.11.3/xarray/backends/api.py --- old/xarray-0.11.2/xarray/backends/api.py 2018-12-31 21:06:26.000000000 +0100 +++ new/xarray-0.11.3/xarray/backends/api.py 2019-01-26 19:17:39.000000000 +0100 @@ -10,7 +10,8 @@ from .. import Dataset, backends, conventions from ..core import indexing -from ..core.combine import _auto_combine, _infer_concat_order_from_positions +from ..core.combine import ( + _CONCAT_DIM_DEFAULT, _auto_combine, _infer_concat_order_from_positions) from ..core.pycompat import basestring, path_type from ..core.utils import close_on_error, is_grib_path, is_remote_uri from .common import ArrayWriter @@ -483,9 +484,6 @@ f.close() -_CONCAT_DIM_DEFAULT = '__infer_concat_dim__' - - def open_mfdataset(paths, chunks=None, concat_dim=_CONCAT_DIM_DEFAULT, compat='no_conflicts', preprocess=None, engine=None, lock=None, data_vars='all', coords='different', @@ -606,7 +604,7 @@ # Coerce 1D input into ND to maintain backwards-compatible API until API # for N-D combine decided # (see https://github.com/pydata/xarray/pull/2553/#issuecomment-445892746) - if concat_dim is None or concat_dim == _CONCAT_DIM_DEFAULT: + if concat_dim is None or concat_dim is _CONCAT_DIM_DEFAULT: concat_dims = concat_dim elif not isinstance(concat_dim, list): concat_dims = [concat_dim] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/xarray/coding/times.py new/xarray-0.11.3/xarray/coding/times.py --- old/xarray-0.11.2/xarray/coding/times.py 2018-12-31 21:06:26.000000000 +0100 +++ new/xarray-0.11.3/xarray/coding/times.py 2019-01-26 19:17:40.000000000 +0100 @@ -359,6 +359,11 @@ time_delta = np.timedelta64(1, delta_units).astype('timedelta64[ns]') ref_date = pd.Timestamp(ref_date) + # If the ref_date Timestamp is timezone-aware, convert to UTC and + # make it timezone-naive (GH 2649). + if ref_date.tz is not None: + ref_date = ref_date.tz_convert(None) + # Wrap the dates in a DatetimeIndex to do the subtraction to ensure # an OverflowError is raised if the ref_date is too far away from # dates to be encoded (GH 2272). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/xarray/core/combine.py new/xarray-0.11.3/xarray/core/combine.py --- old/xarray-0.11.2/xarray/core/combine.py 2018-12-31 21:06:26.000000000 +0100 +++ new/xarray-0.11.3/xarray/core/combine.py 2019-01-26 19:17:40.000000000 +0100 @@ -368,7 +368,7 @@ return concat(datasets, dim=dim, data_vars=data_vars, coords=coords) -_CONCAT_DIM_DEFAULT = '__infer_concat_dim__' +_CONCAT_DIM_DEFAULT = utils.ReprObject('<inferred>') def _infer_concat_order_from_positions(datasets, concat_dims): @@ -493,16 +493,21 @@ return new_combined_ids +def vars_as_keys(ds): + return tuple(sorted(ds)) + + def _auto_combine_1d(datasets, concat_dim=_CONCAT_DIM_DEFAULT, compat='no_conflicts', data_vars='all', coords='different'): # This is just the old auto_combine function (which only worked along 1D) if concat_dim is not None: dim = None if concat_dim is _CONCAT_DIM_DEFAULT else concat_dim - grouped = itertools.groupby(datasets, key=lambda ds: tuple(sorted(ds))) + sorted_datasets = sorted(datasets, key=vars_as_keys) + grouped_by_vars = itertools.groupby(sorted_datasets, key=vars_as_keys) concatenated = [_auto_concat(list(ds_group), dim=dim, data_vars=data_vars, coords=coords) - for id, ds_group in grouped] + for id, ds_group in grouped_by_vars] else: concatenated = datasets merged = merge(concatenated, compat=compat) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/xarray/tests/test_backends.py new/xarray-0.11.3/xarray/tests/test_backends.py --- old/xarray-0.11.2/xarray/tests/test_backends.py 2018-12-31 21:06:26.000000000 +0100 +++ new/xarray-0.11.3/xarray/tests/test_backends.py 2019-01-26 19:20:26.000000000 +0100 @@ -2367,6 +2367,29 @@ with open_mfdataset([tmp], concat_dim=dim) as actual: assert_identical(expected, actual) + def test_open_multi_dataset(self): + # Test for issue GH #1988 and #2647. This makes sure that the + # concat_dim is utilized when specified in open_mfdataset(). + # The additional wrinkle is to ensure that a length greater + # than one is tested as well due to numpy's implicit casting + # of 1-length arrays to booleans in tests, which allowed + # #2647 to still pass the test_open_single_dataset(), + # which is itself still needed as-is because the original + # bug caused one-length arrays to not be used correctly + # in concatenation. + rnddata = np.random.randn(10) + original = Dataset({'foo': ('x', rnddata)}) + dim = DataArray([100, 150], name='baz', dims='baz') + expected = Dataset({'foo': (('baz', 'x'), + np.tile(rnddata[np.newaxis, :], (2, 1)))}, + {'baz': [100, 150]}) + with create_tmp_file() as tmp1, \ + create_tmp_file() as tmp2: + original.to_netcdf(tmp1) + original.to_netcdf(tmp2) + with open_mfdataset([tmp1, tmp2], concat_dim=dim) as actual: + assert_identical(expected, actual) + def test_dask_roundtrip(self): with create_tmp_file() as tmp: data = create_test_data() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/xarray/tests/test_cftimeindex.py new/xarray-0.11.3/xarray/tests/test_cftimeindex.py --- old/xarray-0.11.2/xarray/tests/test_cftimeindex.py 2018-12-31 21:06:26.000000000 +0100 +++ new/xarray-0.11.3/xarray/tests/test_cftimeindex.py 2019-01-26 19:20:41.000000000 +0100 @@ -799,6 +799,7 @@ @pytest.mark.skipif(not has_cftime, reason='cftime not installed') [email protected](reason='https://github.com/pandas-dev/pandas/issues/24263') def test_multiindex(): index = xr.cftime_range('2001-01-01', periods=100, calendar='360_day') mindex = pd.MultiIndex.from_arrays([index]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/xarray/tests/test_coding_times.py new/xarray-0.11.3/xarray/tests/test_coding_times.py --- old/xarray-0.11.2/xarray/tests/test_coding_times.py 2018-12-31 21:06:26.000000000 +0100 +++ new/xarray-0.11.3/xarray/tests/test_coding_times.py 2019-01-26 19:20:26.000000000 +0100 @@ -750,3 +750,19 @@ np.testing.assert_array_equal(num, expected_num) assert units == expected_units assert calendar == expected_calendar + + +def test_encode_cf_datetime_units_with_tz(): + # Regression test for GH 2649 + units = 'days since 2000-01-01T00:00:00-05:00' + calendar = 'proleptic_gregorian' + dates = pd.date_range('2000', periods=3, tz='US/Eastern').values + num, units, calendar = encode_cf_datetime(dates, + units=units, + calendar=calendar) + expected_num = np.array([0, 1, 2]) + expected_units = 'days since 2000-01-01T00:00:00-05:00' + expected_calendar = 'proleptic_gregorian' + np.testing.assert_array_equal(num, expected_num) + assert units == expected_units + assert calendar == expected_calendar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/xarray/tests/test_combine.py new/xarray-0.11.3/xarray/tests/test_combine.py --- old/xarray-0.11.2/xarray/tests/test_combine.py 2018-12-31 21:06:26.000000000 +0100 +++ new/xarray-0.11.3/xarray/tests/test_combine.py 2019-01-26 19:17:40.000000000 +0100 @@ -650,7 +650,7 @@ expected = Dataset({'foo': ('x', [0, 1, 2, 3]), 'bar': ('x', [10, 20, 30, 40])}) - actual = auto_combine(objs, concat_dim=['x', None]) + actual = auto_combine(objs, concat_dim=['x', None], compat='equals') assert_identical(expected, actual) actual = auto_combine(objs) @@ -661,7 +661,19 @@ Dataset({'foo': ('x', [2, 3])})], [Dataset({'bar': ('x', [10, 20])}), Dataset({'bar': ('x', [30, 40])})]] - actual = auto_combine(objs, concat_dim=[None, 'x']) + actual = auto_combine(objs, concat_dim=[None, 'x'], compat='equals') + assert_identical(expected, actual) + + def test_internal_ordering(self): + # This gives a MergeError if _auto_combine_1d is not sorting by + # data_vars correctly, see GH #2662 + objs = [Dataset({'foo': ('x', [0, 1])}), + Dataset({'bar': ('x', [10, 20])}), + Dataset({'foo': ('x', [2, 3])}), + Dataset({'bar': ('x', [30, 40])})] + actual = auto_combine(objs, concat_dim='x', compat='equals') + expected = Dataset({'foo': ('x', [0, 1, 2, 3]), + 'bar': ('x', [10, 20, 30, 40])}) assert_identical(expected, actual) def test_combine_concat_over_redundant_nesting(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/xarray/tests/test_variable.py new/xarray-0.11.3/xarray/tests/test_variable.py --- old/xarray-0.11.2/xarray/tests/test_variable.py 2018-12-31 21:06:47.000000000 +0100 +++ new/xarray-0.11.3/xarray/tests/test_variable.py 2019-01-26 19:20:41.000000000 +0100 @@ -140,8 +140,8 @@ # check value is equal for both ndarray and Variable with warnings.catch_warnings(): warnings.filterwarnings('ignore', "In the future, 'NAT == x'") - assert variable.values[0] == expected_value0 - assert variable[0].values == expected_value0 + np.testing.assert_equal(variable.values[0], expected_value0) + np.testing.assert_equal(variable[0].values, expected_value0) # check type or dtype is consistent for both ndarray and Variable if expected_dtype is None: # check output type instead of array dtype diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xarray-0.11.2/xarray.egg-info/PKG-INFO new/xarray-0.11.3/xarray.egg-info/PKG-INFO --- old/xarray-0.11.2/xarray.egg-info/PKG-INFO 2019-01-03 02:55:57.000000000 +0100 +++ new/xarray-0.11.3/xarray.egg-info/PKG-INFO 2019-01-26 23:11:33.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: xarray -Version: 0.11.2 +Version: 0.11.3 Summary: N-D labeled arrays and datasets in Python Home-page: https://github.com/pydata/xarray Author: xarray Developers
