[Git][debian-gis-team/flox][master] Add upstream patch to fix test failure on i386.
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Fri Jan 13 18:38:30 GMT 2023
Bas Couwenberg pushed to branch master at Debian GIS Project / flox
Commits:
60671554 by Bas Couwenberg at 2023-01-13T19:38:13+01:00
Add upstream patch to fix test failure on i386.
- - - - -
3 changed files:
- debian/changelog
- + debian/patches/pr201-32bit-support-int64-to-intp-for-count.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -4,6 +4,7 @@ flox (0.6.5-4) UNRELEASED; urgency=medium
* Add gbp.conf to use pristine-tar & --source-only-changes by default.
* Temporarily drop python3-dask from build dependencies,
python3-pandas prevents its installation.
+ * Add upstream patch to fix test failure on i386.
-- Bas Couwenberg <sebastic at debian.org> Tue, 10 Jan 2023 08:30:58 +0100
=====================================
debian/patches/pr201-32bit-support-int64-to-intp-for-count.patch
=====================================
@@ -0,0 +1,119 @@
+Description: 32bit support: int64 to intp
+Author: dcherian <deepak at cherian.net>
+Origin: https://github.com/xarray-contrib/flox/pull/201
+Bug: https://github.com/xarray-contrib/flox/issues/200
+
+--- a/tests/test_core.py
++++ b/tests/test_core.py
+@@ -140,7 +140,7 @@ def test_groupby_reduce(
+ elif func == "sum":
+ expected_result = np.array(expected, dtype=dtype)
+ elif func == "count":
+- expected_result = np.array(expected, dtype=np.int64)
++ expected_result = np.array(expected, dtype=np.intp)
+
+ result, groups, = groupby_reduce(
+ array,
+@@ -284,7 +284,7 @@ def test_groupby_reduce_count():
+ array = np.array([0, 0, np.nan, np.nan, np.nan, 1, 1])
+ labels = np.array(["a", "b", "b", "b", "c", "c", "c"])
+ result, _ = groupby_reduce(array, labels, func="count")
+- assert_equal(result, np.array([1, 1, 2], dtype=np.int64))
++ assert_equal(result, np.array([1, 1, 2], dtype=np.intp))
+
+
+ def test_func_is_aggregation():
+@@ -413,7 +413,7 @@ def test_numpy_reduce_axis_subset(engine
+ by = np.broadcast_to(labels2d, (3, *labels2d.shape))
+ array = np.ones_like(by)
+ result, _ = groupby_reduce(array, by, **kwargs, axis=1)
+- subarr = np.array([[1, 1], [1, 1], [0, 2], [1, 1], [1, 1]], dtype=np.int64)
++ subarr = np.array([[1, 1], [1, 1], [0, 2], [1, 1], [1, 1]], dtype=np.intp)
+ expected = np.tile(subarr, (3, 1, 1))
+ assert_equal(result, expected)
+
+@@ -672,7 +672,7 @@ def test_groupby_bins(chunk_labels, chun
+ engine=engine,
+ method=method,
+ )
+- expected = np.array([3, 1, 0], dtype=np.int64)
++ expected = np.array([3, 1, 0], dtype=np.intp)
+ for left, right in zip(groups, pd.IntervalIndex.from_arrays([1, 2, 4], [2, 4, 5]).to_numpy()):
+ assert left == right
+ assert_equal(actual, expected)
+@@ -991,7 +991,8 @@ def test_multiple_groupers_bins(chunk) -
+ ),
+ func="count",
+ )
+- expected = np.eye(5, 5, dtype=np.int64)
++ # output from `count` is intp
++ expected = np.eye(5, 5, dtype=np.intp)
+ assert_equal(expected, actual)
+
+
+@@ -1020,7 +1021,8 @@ def test_multiple_groupers(chunk, by1, b
+ if chunk:
+ by2 = dask.array.from_array(by2)
+
+- expected = np.ones((5, 2), dtype=np.int64)
++ # output from `count` is intp
++ expected = np.ones((5, 2), dtype=np.intp)
+ actual, *_ = groupby_reduce(
+ array, by1, by2, axis=(0, 1), func="count", expected_groups=expected_groups
+ )
+@@ -1059,6 +1061,7 @@ def test_validate_expected_groups_not_no
+
+
+ def test_factorize_reindex_sorting_strings():
++ # pd.factorize seems to return intp so int32 on 32bit arch
+ kwargs = dict(
+ by=(np.array(["El-Nino", "La-Nina", "boo", "Neutral"]),),
+ axis=-1,
+@@ -1066,19 +1069,20 @@ def test_factorize_reindex_sorting_strin
+ )
+
+ expected = factorize_(**kwargs, reindex=True, sort=True)[0]
+- assert_equal(expected, np.array([0, 1, 4, 2], dtype=np.int64))
++ assert_equal(expected, np.array([0, 1, 4, 2], dtype=np.intp))
+
+ expected = factorize_(**kwargs, reindex=True, sort=False)[0]
+- assert_equal(expected, np.array([0, 3, 4, 1], dtype=np.int64))
++ assert_equal(expected, np.array([0, 3, 4, 1], dtype=np.intp))
+
+ expected = factorize_(**kwargs, reindex=False, sort=False)[0]
+- assert_equal(expected, np.array([0, 1, 2, 3], dtype=np.int64))
++ assert_equal(expected, np.array([0, 1, 2, 3], dtype=np.intp))
+
+ expected = factorize_(**kwargs, reindex=False, sort=True)[0]
+- assert_equal(expected, np.array([0, 1, 3, 2], dtype=np.int64))
++ assert_equal(expected, np.array([0, 1, 3, 2], dtype=np.intp))
+
+
+ def test_factorize_reindex_sorting_ints():
++ # pd.factorize seems to return intp so int32 on 32bit arch
+ kwargs = dict(
+ by=(np.array([-10, 1, 10, 2, 3, 5]),),
+ axis=-1,
+@@ -1086,18 +1090,18 @@ def test_factorize_reindex_sorting_ints(
+ )
+
+ expected = factorize_(**kwargs, reindex=True, sort=True)[0]
+- assert_equal(expected, np.array([6, 1, 6, 2, 3, 5], dtype=np.int64))
++ assert_equal(expected, np.array([6, 1, 6, 2, 3, 5], dtype=np.intp))
+
+ expected = factorize_(**kwargs, reindex=True, sort=False)[0]
+- assert_equal(expected, np.array([6, 1, 6, 2, 3, 5], dtype=np.int64))
++ assert_equal(expected, np.array([6, 1, 6, 2, 3, 5], dtype=np.intp))
+
+ kwargs["expected_groups"] = (np.arange(5, -1, -1),)
+
+ expected = factorize_(**kwargs, reindex=True, sort=True)[0]
+- assert_equal(expected, np.array([6, 1, 6, 2, 3, 5], dtype=np.int64))
++ assert_equal(expected, np.array([6, 1, 6, 2, 3, 5], dtype=np.intp))
+
+ expected = factorize_(**kwargs, reindex=True, sort=False)[0]
+- assert_equal(expected, np.array([6, 4, 6, 3, 2, 0], dtype=np.int64))
++ assert_equal(expected, np.array([6, 4, 6, 3, 2, 0], dtype=np.intp))
+
+
+ @requires_dask
=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
0001-Compatibility-with-Pandas-older-than-1.4.patch
+pr201-32bit-support-int64-to-intp-for-count.patch
View it on GitLab: https://salsa.debian.org/debian-gis-team/flox/-/commit/60671554bc8e7eeb80be3e99f66b3320ebac8c4c
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/flox/-/commit/60671554bc8e7eeb80be3e99f66b3320ebac8c4c
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20230113/29b1146a/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list