Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite failure on 32bit architectures #133

Closed
avalentino opened this issue Aug 14, 2022 · 6 comments · Fixed by #136
Closed

Test suite failure on 32bit architectures #133

avalentino opened this issue Aug 14, 2022 · 6 comments · Fixed by #136
Labels
bug Something isn't working

Comments

@avalentino
Copy link
Contributor

=== python3.10 ===
============================= test session starts ==============================
platform linux -- Python 3.10.5, pytest-7.1.2, pluggy-1.0.0+repack
rootdir: /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src, configfile: pyproject.toml
collected 8429 items / 48 deselected / 8381 selected

../build.D7c/src/tests/test_core.py ...ssssss..................ssssss... [  0%]
...............ssssss..................ssssss..................ssssss... [  1%]
...............ssssss..................ssssss..................ssssss... [  2%]
...............ssssss..................ssssss..................ssssss... [  3%]
...............ssssss..................ssssss..................ssssss... [  3%]
...............ssssss..................ssssss..................ssssss... [  4%]
...............ssssss................................................... [  5%]
........................................................................ [  6%]
........................................................................ [  7%]
........................................................................ [  8%]
........................................................................ [  9%]
........................................................................ [  9%]
........................................................................ [ 10%]
........................................................................ [ 11%]
........................................................................ [ 12%]
.............................................................sssssssssss [ 13%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 14%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 15%]
sssssssssssssssssssssssssssssssssssss................................... [ 15%]
.............................................................sssssssssss [ 16%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 17%]
sssssssssssss..........................................ssssssssssss..... [ 18%]
.ssssss..........................................ssssssssssss......sssss [ 19%]
s..........................................ssssssssssss......ssssss..... [ 20%]
.....................................ssssssssssss......ssssss........... [ 21%]
...............................ssssssssssss......ssssss................. [ 21%]
.........................ssssssssssss......ssssss....................... [ 22%]
...................ssssssssssss......ssssss............................. [ 23%]
.............ssssssssssss......ssssss................................... [ 24%]
.......ssssssssssss......ssssss......................................... [ 25%]
.ssssssssssss......ssssss...............ssss..ss..............ssss..ss.. [ 26%]
............ssss..ss..............ssss..ss..............ssss..ss........ [ 27%]
......ssss..ss..............ssss..ss..............ssss..ss.............. [ 27%]
ssss..ss..............ssss..ss..............ssss..ss.F.F.F....xx....xx.. [ 28%]
..xx.........................................................sssssssssss [ 29%]
sssssssssssssssssssss........xxxxxxxxxxxxxxssssxxss..............ssss..s [ 30%]
sxxxxxxxxxxxxxxssssxxss..............ssss..ss..............ssss..ss..... [ 31%]
.........ssss..ssxxxxxxxxxxxxxxssssxxss..............ssss..ss........... [ 32%]
.........ssss..ss......ssssss..................ssssss..................s [ 33%]
sssss..................ssssss..................ssssss..................s [ 33%]
sssss..................ssssss..................ssssss..................s [ 34%]
sssss..................ssssss..................ssssss..................s [ 35%]
sssss..................ssssss..................ssssss..................s [ 36%]
sssss..................ssssss..................ssssss..................s [ 37%]
sssss................................................................... [ 38%]
........................................................................ [ 39%]
........................................................................ [ 39%]
........................................................................ [ 40%]
........................................................................ [ 41%]
........................................................................ [ 42%]
........................................................................ [ 43%]
........................................................................ [ 44%]
........................................................................ [ 45%]
........................................................................ [ 45%]
.....................ssssssssssssssssssssssssssssssssssssssssssssssss... [ 46%]
.............................................sssssssssssssssssssssssssss [ 47%]
sssssssssssssssssssss................................................... [ 48%]
.............................................sssssssssssssssssssssssssss [ 49%]
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss... [ 50%]
.........................................ssss..ssss......ssssss......... [ 51%]
...................................ssss..ssss......ssssss............... [ 51%]
.............................ssss..ssss......ssssss..................... [ 52%]
.......................ssss..ssss......ssssss........................... [ 53%]
.................ssss..ssss......ssssss................................. [ 54%]
...........ssss..ssss......ssssss....................................... [ 55%]
.....ssss..ssss......ssssss............................................s [ 56%]
sss..ssss......ssssss............................................ssss..s [ 57%]
sss......ssssss............................................ssss..ssss... [ 57%]
...ssssss...............ssss..ss..............ssss..ss..............ssss [ 58%]
..ss..............ssss..ss..............ssss..ss...............s.s..ss.. [ 59%]
.............s.s..ss...............s.s..ss...............s.s..ss........ [ 60%]
.......s.s..ss...............s.s..ss.F.F.F....xx....xx....xx............ [ 61%]
.............................................sssssssssssssssssssssssssss [ 62%]
sssss........xxxxxxxxxxxxxxxsxsxxss..............ssss..ssxxxxxxxxxxxxxxx [ 63%]
sxsxxss..............ssss..ss...............s.s..ss..............ssss..s [ 64%]
sxxxxxxxxxxxxxxxsxsxxss..............ssss..ss.....................s.s..s [ 64%]
s....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 65%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 66%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 67%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 68%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 69%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 70%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 70%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 71%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 72%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 73%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 74%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 75%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 76%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 76%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 77%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 78%]
xxxxxssssssssssssssssssssssssssssssssssssssssssssssssxxxxxxxxxxxxxxxxxxx [ 79%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxsssssssssssssssssssssssssssssssssssssssssss [ 80%]
sssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 81%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxsssssssssssssssssssssssssssssssssssssssssss [ 82%]
sssssssssssssssssssssssssssssssssssssssssssssssssssssxxxxxxxxxxxxxxxxxxx [ 82%]
xxxxxxxxxxxxxxxxxxxxxxxxxxsssxxxsssxxxxxxssssssxxxxxxxxxxxxxxxxxxxxxxxxx [ 83%]
xxxxxxxxxxxxxxxxxxxxsssxxxsssxxxxxxssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 84%]
xxxxxxxxxxxxxxsssxxxsssxxxxxxssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 85%]
xxxxxxxxsssxxxsssxxxxxxssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 86%]
xxsssxxxsssxxxxxxssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsssx [ 87%]
xxsssxxxxxxssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsssxxxsssx [ 88%]
xxxxxssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsssxxxsssxxxxxxs [ 88%]
sssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsssxxxsssxxxxxxssssssx [ 89%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsssxxxsssxxxxxxssssssxxxxxxx [ 90%]
xxxxxxxxxsxsxxssxxxxxxxxxxxxxxxsxsxxssxxxxxxxxxxxxxxxsxsxxssxxxxxxxxxxxx [ 91%]
xxxsxsxxssxxxxxxxxxxxxxxxsxsxxssxxxxxxxxxxxxxxxsxsxxssxxxxxxxxxxxxxxxsxs [ 92%]
xxssxxxxxxxxxxxxxxxsxsxxssxxxxxxxxxxxxxxxsxsxxssxxxxxxxxxxxxxxxsxsxxssxx [ 93%]
xxxxxxxxxxxxxsxsxxssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [ 94%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxssssxxxxssssxxxxxxxxssssssssxxxxxxxxxxx [ 94%]
xxxxxxxxxxxxsxsxxssxxxxxxxxxxxxxxxsxsxxssxxxxxxxxxxxxxxxsxsxxssxxxxxxxxx [ 95%]
xxxxxxsxsxxssxxxxxxxxxxxxxxxsxsxxssxxxxxxxxxxxxxxxsxsxxssxxxxxxxxxxxxxxx [ 96%]
sxsxxssxxxxxxxxxxxxxxxsxsxxssxxxxxxxxxxxxxxxxxxxxxsxsxxssxxxx........... [ 97%]
............xxX................................                          [ 98%]
../build.D7c/src/tests/test_xarray.py .....................ssssss...ssss [ 98%]
ss.s...s..........................ssssss...ssssss.s...s.....xxxxxxxxxxxx [ 99%]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..............s......                 [100%]

=================================== FAILURES ===================================
_______ test_groupby_reduce_nans[flox-2-groups0-expected_shape0-chunks1] _______
../build.D7c/src/tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:287: in assert_eq
    raise AssertionError(f"a and b have different dtypes: (a: {adt}, b: {bdt})")
E   AssertionError: a and b have different dtypes: (a: int32, b: int64)
_____ test_groupby_reduce_nans[flox-None-groups1-expected_shape1-chunks1] ______
../build.D7c/src/tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:287: in assert_eq
    raise AssertionError(f"a and b have different dtypes: (a: {adt}, b: {bdt})")
E   AssertionError: a and b have different dtypes: (a: int32, b: int64)
_____ test_groupby_reduce_nans[flox-None-groups2-expected_shape2-chunks1] ______
../build.D7c/src/tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:287: in assert_eq
    raise AssertionError(f"a and b have different dtypes: (a: {adt}, b: {bdt})")
E   AssertionError: a and b have different dtypes: (a: int32, b: int64)
______ test_groupby_reduce_nans[numpy-2-groups0-expected_shape0-chunks1] _______
../build.D7c/src/tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:287: in assert_eq
    raise AssertionError(f"a and b have different dtypes: (a: {adt}, b: {bdt})")
E   AssertionError: a and b have different dtypes: (a: int32, b: int64)
_____ test_groupby_reduce_nans[numpy-None-groups1-expected_shape1-chunks1] _____
../build.D7c/src/tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:287: in assert_eq
    raise AssertionError(f"a and b have different dtypes: (a: {adt}, b: {bdt})")
E   AssertionError: a and b have different dtypes: (a: int32, b: int64)
_____ test_groupby_reduce_nans[numpy-None-groups2-expected_shape2-chunks1] _____
../build.D7c/src/tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:287: in assert_eq
    raise AssertionError(f"a and b have different dtypes: (a: {adt}, b: {bdt})")
E   AssertionError: a and b have different dtypes: (a: int32, b: int64)
=============================== warnings summary ===============================
../build.D7c/src/tests/__init__.py:3
  /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src/tests/__init__.py:3: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
    from distutils import version

../../../../usr/lib/python3/dist-packages/numpy_groupies/utils_numpy.py:101
  /usr/lib/python3/dist-packages/numpy_groupies/utils_numpy.py:101: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. 
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    'array': np.object,

tests/test_core.py: 1800 warnings
  /usr/lib/python3/dist-packages/dask/array/core.py:1593: FutureWarning: The `numpy.expand_dims` function is not implemented by Dask array. You may want to use the da.map_blocks function or something similar to silence this warning. Your code may stop working in a future release.
    warnings.warn(

tests/test_core.py: 12 warnings
  /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src/tests/test_core.py:182: RuntimeWarning: Mean of empty slice
    expected = getattr(np, func)(array[..., ~nanmask], axis=-1, **kwargs)

tests/test_core.py: 15 warnings
  /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src/flox/aggregate_flox.py:105: RuntimeWarning: invalid value encountered in true_divide
    out /= nanlen(group_idx, array, size=size, axis=axis, fill_value=0)

tests/test_core.py: 82 warnings
  /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src/flox/aggregations.py:258: RuntimeWarning: invalid value encountered in true_divide
    finalize=lambda sum_, count: sum_ / count,

tests/test_core.py: 12 warnings
  /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src/tests/test_core.py:182: RuntimeWarning: Degrees of freedom <= 0 for slice.
    expected = getattr(np, func)(array[..., ~nanmask], axis=-1, **kwargs)

tests/test_core.py: 292 warnings
  /usr/lib/python3/dist-packages/numpy_groupies/aggregate_numpy.py:156: RuntimeWarning: invalid value encountered in true_divide
    means = sums.astype(dtype) / counts

tests/test_core.py: 264 warnings
  /usr/lib/python3/dist-packages/numpy_groupies/aggregate_numpy.py:157: RuntimeWarning: invalid value encountered in true_divide
    ret = np.bincount(group_idx, (a - means[group_idx]) ** 2,

tests/test_core.py: 216 warnings
  /usr/lib/python3/dist-packages/dask/array/numpy_compat.py:40: RuntimeWarning: invalid value encountered in true_divide
    x = np.divide(x1, x2, out)

tests/test_core.py: 400 warnings
  /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src/flox/aggregations.py:267: RuntimeWarning: invalid value encountered in true_divide
    result = (sumsq - (sum_**2 / count)) / (count - ddof)

tests/test_core.py: 12 warnings
  /usr/lib/python3/dist-packages/numpy/lib/nanfunctions.py:1670: RuntimeWarning: Degrees of freedom <= 0 for slice.
    var = nanvar(a, axis=axis, dtype=dtype, out=out, ddof=ddof,

tests/test_core.py: 38 warnings
  /usr/lib/python3/dist-packages/dask/array/reductions.py:567: RuntimeWarning: All-NaN slice encountered
    return np.nanmax(x_chunk, axis=axis, keepdims=keepdims)

tests/test_core.py: 24 warnings
  /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src/tests/test_core.py:182: RuntimeWarning: All-NaN slice encountered
    expected = getattr(np, func)(array[..., ~nanmask], axis=-1, **kwargs)

tests/test_core.py: 140 warnings
  /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src/flox/core.py:816: RuntimeWarning: All-NaN slice encountered
    result = getattr(np, combine)(array, axis=axis[:-1] + (DUMMY_AXIS,), keepdims=True)

tests/test_core.py: 38 warnings
  /usr/lib/python3/dist-packages/dask/array/reductions.py:538: RuntimeWarning: All-NaN slice encountered
    return np.nanmin(x_chunk, axis=axis, keepdims=keepdims)

tests/test_core.py: 22 warnings
  /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src/flox/aggregate_flox.py:96: RuntimeWarning: divide by zero encountered in true_divide
    out /= nanlen(group_idx, array, size=size, axis=axis, fill_value=0)

tests/test_core.py: 46 warnings
  /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src/flox/aggregations.py:249: RuntimeWarning: invalid value encountered in true_divide
    finalize=lambda sum_, count: sum_ / count,

tests/test_core.py: 22 warnings
  /tmp/autopkgtest-lxc.86e5wyro/downtmp/build.D7c/src/flox/aggregate_flox.py:105: RuntimeWarning: divide by zero encountered in true_divide
    out /= nanlen(group_idx, array, size=size, axis=axis, fill_value=0)

tests/test_core.py: 20 warnings
  /usr/lib/python3/dist-packages/dask/array/reductions.py:991: RuntimeWarning: All-NaN slice encountered
    vals = func(x, axis=arg_axis, keepdims=True)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED ../build.D7c/src/tests/test_core.py::test_groupby_reduce_nans[flox-2-groups0-expected_shape0-chunks1]
FAILED ../build.D7c/src/tests/test_core.py::test_groupby_reduce_nans[flox-None-groups1-expected_shape1-chunks1]
FAILED ../build.D7c/src/tests/test_core.py::test_groupby_reduce_nans[flox-None-groups2-expected_shape2-chunks1]
FAILED ../build.D7c/src/tests/test_core.py::test_groupby_reduce_nans[numpy-2-groups0-expected_shape0-chunks1]
FAILED ../build.D7c/src/tests/test_core.py::test_groupby_reduce_nans[numpy-None-groups1-expected_shape1-chunks1]
FAILED ../build.D7c/src/tests/test_core.py::test_groupby_reduce_nans[numpy-None-groups2-expected_shape2-chunks1]
= 6 failed, 4164 passed, 1735 skipped, 48 deselected, 2475 xfailed, 1 xpassed, 3457 warnings in 307.36s (0:05:07) =
@dcherian
Copy link
Collaborator

Thanks for the bug report @avalentino

can you change intp to int64 here and try the tests again please?

flox/flox/aggregations.py

Lines 229 to 230 in e405517

dtypes=np.intp,
final_dtype=np.intp,

If that works, a pull request with that change would be very welcome

@dcherian dcherian added the bug Something isn't working label Aug 15, 2022
@avalentino
Copy link
Contributor Author

Dear @dcherian, unfortunately it still does not work, but th error seems to be a little bit different now:

$ python3 -m pytest -k test_groupby_reduce_nans
=========================================================== test session starts ===========================================================
platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.0.0+repack
rootdir: /home/antonio/debian/git/flox, configfile: pyproject.toml
collected 8429 items / 8411 deselected / 18 selected                                                                                      

tests/test_core.py .F.F.F.F.F.Fxxxxxx                                                                                               [100%]

================================================================ FAILURES =================================================================
____________________________________ test_groupby_reduce_nans[flox-2-groups0-expected_shape0-chunks1] _____________________________________
tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:282: in assert_eq
    a, adt, a_meta, a_computed = _get_dt_meta_computed(
/usr/lib/python3/dist-packages/dask/array/utils.py:244: in _get_dt_meta_computed
    x = _check_chunks(x)
/usr/lib/python3/dist-packages/dask/array/utils.py:225: in _check_chunks
    assert chunk.dtype == x.dtype
E   AssertionError
___________________________________ test_groupby_reduce_nans[flox-None-groups1-expected_shape1-chunks1] ___________________________________
tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:282: in assert_eq
    a, adt, a_meta, a_computed = _get_dt_meta_computed(
/usr/lib/python3/dist-packages/dask/array/utils.py:244: in _get_dt_meta_computed
    x = _check_chunks(x)
/usr/lib/python3/dist-packages/dask/array/utils.py:225: in _check_chunks
    assert chunk.dtype == x.dtype
E   AssertionError
___________________________________ test_groupby_reduce_nans[flox-None-groups2-expected_shape2-chunks1] ___________________________________
tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:282: in assert_eq
    a, adt, a_meta, a_computed = _get_dt_meta_computed(
/usr/lib/python3/dist-packages/dask/array/utils.py:244: in _get_dt_meta_computed
    x = _check_chunks(x)
/usr/lib/python3/dist-packages/dask/array/utils.py:225: in _check_chunks
    assert chunk.dtype == x.dtype
E   AssertionError
____________________________________ test_groupby_reduce_nans[numpy-2-groups0-expected_shape0-chunks1] ____________________________________
tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:282: in assert_eq
    a, adt, a_meta, a_computed = _get_dt_meta_computed(
/usr/lib/python3/dist-packages/dask/array/utils.py:244: in _get_dt_meta_computed
    x = _check_chunks(x)
/usr/lib/python3/dist-packages/dask/array/utils.py:225: in _check_chunks
    assert chunk.dtype == x.dtype
E   AssertionError
__________________________________ test_groupby_reduce_nans[numpy-None-groups1-expected_shape1-chunks1] ___________________________________
tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:282: in assert_eq
    a, adt, a_meta, a_computed = _get_dt_meta_computed(
/usr/lib/python3/dist-packages/dask/array/utils.py:244: in _get_dt_meta_computed
    x = _check_chunks(x)
/usr/lib/python3/dist-packages/dask/array/utils.py:225: in _check_chunks
    assert chunk.dtype == x.dtype
E   AssertionError
__________________________________ test_groupby_reduce_nans[numpy-None-groups2-expected_shape2-chunks1] ___________________________________
tests/test_core.py:507: in test_groupby_reduce_nans
    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
/usr/lib/python3/dist-packages/dask/array/utils.py:282: in assert_eq
    a, adt, a_meta, a_computed = _get_dt_meta_computed(
/usr/lib/python3/dist-packages/dask/array/utils.py:244: in _get_dt_meta_computed
    x = _check_chunks(x)
/usr/lib/python3/dist-packages/dask/array/utils.py:225: in _check_chunks
    assert chunk.dtype == x.dtype
E   AssertionError
============================================================ warnings summary =============================================================
tests/__init__.py:3
  /home/antonio/debian/git/flox/tests/__init__.py:3: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
    from distutils import version

../../../../../usr/lib/python3/dist-packages/numpy_groupies/utils_numpy.py:101
  /usr/lib/python3/dist-packages/numpy_groupies/utils_numpy.py:101: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. 
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    'array': np.object,

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================= short test summary info =========================================================
FAILED tests/test_core.py::test_groupby_reduce_nans[flox-2-groups0-expected_shape0-chunks1] - AssertionError
FAILED tests/test_core.py::test_groupby_reduce_nans[flox-None-groups1-expected_shape1-chunks1] - AssertionError
FAILED tests/test_core.py::test_groupby_reduce_nans[flox-None-groups2-expected_shape2-chunks1] - AssertionError
FAILED tests/test_core.py::test_groupby_reduce_nans[numpy-2-groups0-expected_shape0-chunks1] - AssertionError
FAILED tests/test_core.py::test_groupby_reduce_nans[numpy-None-groups1-expected_shape1-chunks1] - AssertionError
FAILED tests/test_core.py::test_groupby_reduce_nans[numpy-None-groups2-expected_shape2-chunks1] - AssertionError
=================================== 6 failed, 6 passed, 8411 deselected, 6 xfailed, 2 warnings in 1.55s ===================================

@dcherian
Copy link
Collaborator

dcherian commented Aug 15, 2022

What is the dtype of np.sum([True, False]) on your platform? np.int32?

I've consistently used np.intp in the code (aggregations.py) except in the tests. So maybe the solution is to find-replace int64 with intp in the tests.

@avalentino
Copy link
Contributor Author

Yes, this is the way to go:

diff --git a/tests/test_core.py b/tests/test_core.py
index 9c0bd6a..c70ae83 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -504,7 +504,7 @@ def test_groupby_reduce_nans(chunks, axis, groups, expected_shape, engine):
         fill_value=0,
         engine=engine,
     )
-    assert_equal(result, np.zeros(expected_shape, dtype=np.int64))
+    assert_equal(result, np.zeros(expected_shape, dtype=np.intp))
 
     # now when subsets are NaN
     # labels = np.array([0, 0, 1, 1, 1], dtype=float)

@dcherian
Copy link
Collaborator

OK can you send in a PR so you get credit for it?

@avalentino
Copy link
Contributor Author

Done: #136.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants