From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/xarray/files/, dev-python/xarray/
Date: Sat, 3 Jul 2021 16:06:46 +0000 (UTC) [thread overview]
Message-ID: <1625328398.f231076548125ab4780412b9c58514b251b79fcb.mgorny@gentoo> (raw)
commit: f231076548125ab4780412b9c58514b251b79fcb
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 3 11:12:50 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 3 16:06:38 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2310765
dev-python/xarray: Backport pandas & dask compatibility fixes
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../xarray/files/xarray-0.18.2-backports.patch | 116 +++++++++++++++++++++
...array-0.18.2.ebuild => xarray-0.18.2-r1.ebuild} | 4 +
2 files changed, 120 insertions(+)
diff --git a/dev-python/xarray/files/xarray-0.18.2-backports.patch b/dev-python/xarray/files/xarray-0.18.2-backports.patch
new file mode 100644
index 00000000000..be30702e67f
--- /dev/null
+++ b/dev-python/xarray/files/xarray-0.18.2-backports.patch
@@ -0,0 +1,116 @@
+From ca72d56c213a1c47e54b12ee559f412e60fbf9b1 Mon Sep 17 00:00:00 2001
+From: Spencer Clark <spencerkclark@gmail.com>
+Date: Sat, 22 May 2021 20:13:19 -0400
+Subject: [PATCH] Make `kind` argument in `CFTimeIndex._maybe_cast_slice_bound`
+ optional (#5359)
+
+* [test-upstream] Make kind argument in CFTimeIndex._maybe_cast_slice_bound optional
+
+* Update doc/whats-new.rst
+
+Co-authored-by: keewis <keewis@users.noreply.github.com>
+
+Co-authored-by: keewis <keewis@users.noreply.github.com>
+---
+ doc/whats-new.rst | 4 ++++
+ xarray/coding/cftimeindex.py | 9 +++++++--
+ 2 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/xarray/coding/cftimeindex.py b/xarray/coding/cftimeindex.py
+index f0de5565..783fe8d0 100644
+--- a/xarray/coding/cftimeindex.py
++++ b/xarray/coding/cftimeindex.py
+@@ -465,9 +465,14 @@ class CFTimeIndex(pd.Index):
+ else:
+ return pd.Index.get_loc(self, key, method=method, tolerance=tolerance)
+
+- def _maybe_cast_slice_bound(self, label, side, kind):
++ def _maybe_cast_slice_bound(self, label, side, kind=None):
+ """Adapted from
+- pandas.tseries.index.DatetimeIndex._maybe_cast_slice_bound"""
++ pandas.tseries.index.DatetimeIndex._maybe_cast_slice_bound
++
++ Note that we have never used the kind argument in CFTimeIndex and it is
++ deprecated as of pandas version 1.3.0. It exists only for compatibility
++ reasons. We can remove it when our minimum version of pandas is 1.3.0.
++ """
+ if not isinstance(label, str):
+ return label
+
+--
+2.32.0
+
+From 34dc57717c82a86455a9e5abb0a47df782266c7e Mon Sep 17 00:00:00 2001
+From: Mathias Hauser <mathause@users.noreply.github.com>
+Date: Mon, 7 Jun 2021 23:05:24 +0200
+Subject: [PATCH] fix dask meta and output_dtypes error (#5449)
+
+---
+ xarray/tests/test_computation.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/xarray/tests/test_computation.py b/xarray/tests/test_computation.py
+index b7ae1ca9..09bed724 100644
+--- a/xarray/tests/test_computation.py
++++ b/xarray/tests/test_computation.py
+@@ -1306,7 +1306,10 @@ def test_vectorize_dask_dtype_without_output_dtypes(data_array):
+ assert expected.dtype == actual.dtype
+
+
+-@pytest.mark.xfail(LooseVersion(dask.__version__) < "2.3", reason="dask GH5274")
++@pytest.mark.skipif(
++ LooseVersion(dask.__version__) > "2021.06",
++ reason="dask/dask#7669: can no longer pass output_dtypes and meta",
++)
+ @requires_dask
+ def test_vectorize_dask_dtype_meta():
+ # meta dtype takes precedence
+--
+2.32.0
+
+From 5a14d7d398be7e0efc6d5c8920dc8886212c3b2a Mon Sep 17 00:00:00 2001
+From: Spencer Clark <spencerkclark@gmail.com>
+Date: Sat, 12 Jun 2021 08:58:42 -0400
+Subject: [PATCH] Explicitly state datetime units in array constructors in
+ `test_datetime_mean` (#5463)
+
+---
+ xarray/tests/test_duck_array_ops.py | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/xarray/tests/test_duck_array_ops.py b/xarray/tests/test_duck_array_ops.py
+index 0eb00725..6d49e209 100644
+--- a/xarray/tests/test_duck_array_ops.py
++++ b/xarray/tests/test_duck_array_ops.py
+@@ -285,15 +285,15 @@ def assert_dask_array(da, dask):
+ def test_datetime_mean(dask):
+ # Note: only testing numpy, as dask is broken upstream
+ da = DataArray(
+- np.array(["2010-01-01", "NaT", "2010-01-03", "NaT", "NaT"], dtype="M8"),
++ np.array(["2010-01-01", "NaT", "2010-01-03", "NaT", "NaT"], dtype="M8[ns]"),
+ dims=["time"],
+ )
+ if dask:
+ # Trigger use case where a chunk is full of NaT
+ da = da.chunk({"time": 3})
+
+- expect = DataArray(np.array("2010-01-02", dtype="M8"))
+- expect_nat = DataArray(np.array("NaT", dtype="M8"))
++ expect = DataArray(np.array("2010-01-02", dtype="M8[ns]"))
++ expect_nat = DataArray(np.array("NaT", dtype="M8[ns]"))
+
+ actual = da.mean()
+ if dask:
+@@ -889,8 +889,6 @@ def test_push_dask():
+ # some chunks of size-1 with NaN
+ with raise_if_dask_computes():
+ actual = push(
+- dask.array.from_array(array, chunks=(1, 2, 3, 2, 2, 1, 1)),
+- axis=0,
+- n=None,
++ dask.array.from_array(array, chunks=(1, 2, 3, 2, 2, 1, 1)), axis=0, n=None
+ )
+ np.testing.assert_equal(actual, expected)
+--
+2.32.0
+
diff --git a/dev-python/xarray/xarray-0.18.2.ebuild b/dev-python/xarray/xarray-0.18.2-r1.ebuild
similarity index 95%
rename from dev-python/xarray/xarray-0.18.2.ebuild
rename to dev-python/xarray/xarray-0.18.2-r1.ebuild
index bedc8b3da11..573e03b4e44 100644
--- a/dev-python/xarray/xarray-0.18.2.ebuild
+++ b/dev-python/xarray/xarray-0.18.2-r1.ebuild
@@ -32,6 +32,10 @@ BDEPEND="
distutils_enable_tests pytest
+PATCHES=(
+ "${FILESDIR}"/${P}-backports.patch
+)
+
python_test() {
local deselect=(
# warning-targeted tests are fragile and not important to end users
next reply other threads:[~2021-07-03 16:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-03 16:06 Michał Górny [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-20 11:48 [gentoo-commits] repo/gentoo:master commit in: dev-python/xarray/files/, dev-python/xarray/ Michał Górny
2022-09-22 7:45 Michał Górny
2021-08-26 15:31 Michał Górny
2020-12-14 8:07 Michał Górny
2018-08-23 19:09 Virgil Dupras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1625328398.f231076548125ab4780412b9c58514b251b79fcb.mgorny@gentoo \
--to=mgorny@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox