Hello community, here is the log from the commit of package python-awkward for openSUSE:Factory checked in at 2020-12-17 17:05:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-awkward (Old) and /work/SRC/openSUSE:Factory/.python-awkward.new.5145 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-awkward" Thu Dec 17 17:05:05 2020 rev:2 rq:856491 version:1.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-awkward/python-awkward.changes 2020-12-16 11:01:10.735610645 +0100 +++ /work/SRC/openSUSE:Factory/.python-awkward.new.5145/python-awkward.changes 2020-12-17 17:08:52.241944992 +0100 @@ -1,0 +2,6 @@ +Wed Dec 16 00:13:41 UTC 2020 - Atri Bhattacharya <[email protected]> + +- Add awkward-tests-on-32bit.patch: Fix tests on 32 bit systems; + patch taken from upstream PR [gh#scikit-hep/awkward-1.0#600]. + +------------------------------------------------------------------- New: ---- awkward-tests-on-32bit.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-awkward.spec ++++++ --- /var/tmp/diff_new_pack.2bqyOn/_old 2020-12-17 17:08:52.749945496 +0100 +++ /var/tmp/diff_new_pack.2bqyOn/_new 2020-12-17 17:08:52.757945505 +0100 @@ -29,6 +29,8 @@ Patch0: awkward-cmake-build-with-RelWithDebInfo.patch # PATCH-FEATURE-OPENSUSE awkward-correct-includedir.patch badshah400#gmail.com -- Make awkward.config return the correct includedir where we move the header files to Patch1: awkward-correct-includedir.patch +# PATCH-FIX-UPSTREAM awkward-tests-on-32bit.patch gh#scikit-hep/awkward-1.0#600 -- Fix tests on 32 bit systems; patch taken from upstream PR +Patch2: awkward-tests-on-32bit.patch BuildRequires: %{python_module setuptools} BuildRequires: cmake BuildRequires: fdupes @@ -95,13 +97,7 @@ %python_expand %fdupes %{buildroot}%{$python_sitearch} %check -# Disable tests failing on 32-bit due to use of 64 data types -# https://github.com/scikit-hep/awkward-1.0/issues/600 -%ifarch %ix86 -%pytest_arch -k "not (test_0056-partitioned-array.py or test_0080-flatpandas-multiindex-rows-and-columns.py or test_0166-0167-0170-random-issues.py or test_0331-pandas-indexedarray.py)" -%else %pytest_arch -%endif %files %{python_files} %doc README.md ++++++ awkward-tests-on-32bit.patch ++++++ From 5bafaebfe9783d92eda93262a11f4812d537659b Mon Sep 17 00:00:00 2001 From: Jim Pivarski <[email protected]> Date: Tue, 15 Dec 2020 23:51:32 +0000 Subject: [PATCH 1/2] Make tests work in 32-bit. --- src/awkward/_util.py | 1 + src/awkward/behaviors/string.py | 2 +- src/awkward/operations/convert.py | 2 +- tests/test_0115-generic-reducer-operation.py | 32 ++++++-------------- 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src/awkward/_util.py b/src/awkward/_util.py index eaba93686..4d612f866 100644 --- a/src/awkward/_util.py +++ b/src/awkward/_util.py @@ -21,6 +21,7 @@ py27 = sys.version_info[0] < 3 py35 = sys.version_info[0] == 3 and sys.version_info[1] <= 5 win = os.name == "nt" +bits32 = ak.nplike.numpy.iinfo(np.intp).bits == 32 # to silence flake8 F821 errors if py27: diff --git a/src/awkward/behaviors/string.py b/src/awkward/behaviors/string.py index 0cc3e79b4..44b166cc6 100644 --- a/src/awkward/behaviors/string.py +++ b/src/awkward/behaviors/string.py @@ -155,7 +155,7 @@ def _string_broadcast(layout, offsets): nplike = ak.nplike.of(offsets) offsets = nplike.asarray(offsets) counts = offsets[1:] - offsets[:-1] - if ak._util.win: + if ak._util.win or ak._util.bits32: counts = counts.astype(np.int32) parents = nplike.repeat(nplike.arange(len(counts), dtype=counts.dtype), counts) return ak.layout.IndexedArray64(ak.layout.Index64(parents), layout).project() diff --git a/src/awkward/operations/convert.py b/src/awkward/operations/convert.py index 3b1d56c65..937e1c0ab 100644 --- a/src/awkward/operations/convert.py +++ b/src/awkward/operations/convert.py @@ -4592,7 +4592,7 @@ def recurse(layout, row_arrays, col_names): offsets = numpy.asarray(offsets) starts, stops = offsets[:-1], offsets[1:] counts = stops - starts - if ak._util.win: + if ak._util.win or ak._util.bits32: counts = counts.astype(np.int32) if len(row_arrays) == 0: newrows = [ diff --git a/tests/test_0115-generic-reducer-operation.py b/tests/test_0115-generic-reducer-operation.py index ba8139bbc..e988aea40 100644 --- a/tests/test_0115-generic-reducer-operation.py +++ b/tests/test_0115-generic-reducer-operation.py @@ -1427,28 +1427,16 @@ def test_nonreducers(): } ) - assert ak.to_list(ak.mean(y, axis=-1)) == ak.to_list( - np.mean(ak.to_numpy(y), axis=-1) - ) - assert ak.to_list(ak.var(y, axis=-1)) == ak.to_list(np.var(ak.to_numpy(y), axis=-1)) - assert ak.to_list(ak.var(y, axis=-1, ddof=1)) == ak.to_list( - np.var(ak.to_numpy(y), axis=-1, ddof=1) - ) - assert ak.to_list(ak.std(y, axis=-1)) == ak.to_list(np.std(ak.to_numpy(y), axis=-1)) - assert ak.to_list(ak.std(y, axis=-1, ddof=1)) == ak.to_list( - np.std(ak.to_numpy(y), axis=-1, ddof=1) - ) - - assert ak.to_list(ak.moment(y, 1, axis=-1)) == ak.to_list( - np.mean(ak.to_numpy(y), axis=-1) - ) - assert ak.to_list(ak.moment(y - ak.mean(y, axis=-1), 2, axis=-1)) == ak.to_list( - np.var(ak.to_numpy(y), axis=-1) - ) - assert ak.to_list(ak.covar(y, y, axis=-1)) == ak.to_list( - np.var(ak.to_numpy(y), axis=-1) - ) - assert ak.to_list(ak.corr(y, y, axis=-1)) == [1.0, 1.0] + assert np.isclose(ak.mean(y, axis=-1), np.mean(ak.to_numpy(y), axis=-1)).all() + assert np.isclose(ak.var(y, axis=-1), np.var(ak.to_numpy(y), axis=-1)).all() + assert np.isclose(ak.var(y, axis=-1, ddof=1), np.var(ak.to_numpy(y), axis=-1, ddof=1)).all() + assert np.isclose(ak.std(y, axis=-1), np.std(ak.to_numpy(y), axis=-1)).all() + assert np.isclose(ak.std(y, axis=-1, ddof=1), np.std(ak.to_numpy(y), axis=-1, ddof=1)).all() + + assert np.isclose(ak.moment(y, 1, axis=-1), np.mean(ak.to_numpy(y), axis=-1)).all() + assert np.isclose(ak.moment(y - ak.mean(y, axis=-1), 2, axis=-1), np.var(ak.to_numpy(y), axis=-1)).all() + assert np.isclose(ak.covar(y, y, axis=-1), np.var(ak.to_numpy(y), axis=-1)).all() + assert np.isclose(ak.corr(y, y, axis=-1), [1.0, 1.0]).all() assert ak.to_list(ak.corr(x, y, axis=-1)) == pytest.approx( [0.9975103695813371, 0.9964193240901015] From d84367ff90e863ef21b1ee4f307f7fe5d6676b70 Mon Sep 17 00:00:00 2001 From: Jim Pivarski <[email protected]> Date: Tue, 15 Dec 2020 18:02:06 -0600 Subject: [PATCH 2/2] Make it work in 64-bit, too. --- tests/test_0115-generic-reducer-operation.py | 36 ++++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/tests/test_0115-generic-reducer-operation.py b/tests/test_0115-generic-reducer-operation.py index e988aea40..b82c2c6ff 100644 --- a/tests/test_0115-generic-reducer-operation.py +++ b/tests/test_0115-generic-reducer-operation.py @@ -1427,16 +1427,32 @@ def test_nonreducers(): } ) - assert np.isclose(ak.mean(y, axis=-1), np.mean(ak.to_numpy(y), axis=-1)).all() - assert np.isclose(ak.var(y, axis=-1), np.var(ak.to_numpy(y), axis=-1)).all() - assert np.isclose(ak.var(y, axis=-1, ddof=1), np.var(ak.to_numpy(y), axis=-1, ddof=1)).all() - assert np.isclose(ak.std(y, axis=-1), np.std(ak.to_numpy(y), axis=-1)).all() - assert np.isclose(ak.std(y, axis=-1, ddof=1), np.std(ak.to_numpy(y), axis=-1, ddof=1)).all() - - assert np.isclose(ak.moment(y, 1, axis=-1), np.mean(ak.to_numpy(y), axis=-1)).all() - assert np.isclose(ak.moment(y - ak.mean(y, axis=-1), 2, axis=-1), np.var(ak.to_numpy(y), axis=-1)).all() - assert np.isclose(ak.covar(y, y, axis=-1), np.var(ak.to_numpy(y), axis=-1)).all() - assert np.isclose(ak.corr(y, y, axis=-1), [1.0, 1.0]).all() + assert ak.to_list(ak.mean(y, axis=-1)) == pytest.approx( + ak.to_list(np.mean(ak.to_numpy(y), axis=-1)) + ) + assert ak.to_list(ak.var(y, axis=-1)) == pytest.approx( + ak.to_list(np.var(ak.to_numpy(y), axis=-1)) + ) + assert ak.to_list(ak.var(y, axis=-1, ddof=1)) == pytest.approx( + ak.to_list(np.var(ak.to_numpy(y), axis=-1, ddof=1)) + ) + assert ak.to_list(ak.std(y, axis=-1)) == pytest.approx( + ak.to_list(np.std(ak.to_numpy(y), axis=-1)) + ) + assert ak.to_list(ak.std(y, axis=-1, ddof=1)) == pytest.approx( + ak.to_list(np.std(ak.to_numpy(y), axis=-1, ddof=1)) + ) + + assert ak.to_list(ak.moment(y, 1, axis=-1)) == pytest.approx( + ak.to_list(np.mean(ak.to_numpy(y), axis=-1)) + ) + assert ak.to_list(ak.moment(y - ak.mean(y, axis=-1), 2, axis=-1)) == pytest.approx( + ak.to_list(np.var(ak.to_numpy(y), axis=-1)) + ) + assert ak.to_list(ak.covar(y, y, axis=-1)) == pytest.approx( + ak.to_list(np.var(ak.to_numpy(y), axis=-1)) + ) + assert ak.to_list(ak.corr(y, y, axis=-1)) == pytest.approx([1.0, 1.0]) assert ak.to_list(ak.corr(x, y, axis=-1)) == pytest.approx( [0.9975103695813371, 0.9964193240901015] _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
