question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

numpy ediff1d tests have TypeError in `to_end` (numpy 1.19)

See original GitHub issue
  • I have tried using the latest released version of Numba: 0.50.1
  • I have included below a minimal working reproducer

I’m seeing some errors in tests, building and running numba 0.50.1 on Debian unstable (python 3.8.3, numpy 1.19.0).

I’ll focus on runtime test failures here (running tests on installed system, not build-time tests). Runtime tests are triggered with MPLBACKEND=Agg python3.8 -Wd -m numba.runtests -v -m but the failing test can be run manually:

python3 -m pytest -k "test_ediff1d_edge_cases" /usr/lib/python3/dist-packages/numba/tests/test_np_functions.py -v

The error summary is

======================================================================
ERROR: test_ediff1d_edge_cases (numba.tests.test_np_functions.TestNPFunctions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/numba/tests/test_np_functions.py", line 2045, in test_ediff1d_edge_cases
    _check_raises_type_error(params, 'to_begin')
  File "/usr/lib/python3/dist-packages/numba/tests/test_np_functions.py", line 2012, in _check_raises_type_error
    pyfunc(**params)
  File "/usr/lib/python3/dist-packages/numba/tests/test_np_functions.py", line 229, in ediff1d
    return np.ediff1d(ary, to_end, to_begin)
  File "<__array_function__ internals>", line 5, in ediff1d
  File "/usr/lib/python3/dist-packages/numpy/lib/arraysetops.py", line 107, in ediff1d
    raise TypeError("dtype of `to_end` must be compatible "
TypeError: dtype of `to_end` must be compatible with input `ary` under the `same_kind` rule.

This is with numpy 1.19 which has only just been released, so I’m wondering if it’s an adjustment which numba needs to make in test_ediff1d_edge_cases to work with the new numpy.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
stuartarchibaldcommented, Oct 5, 2020

I just tried writing the patch to make this work and discovered https://github.com/numpy/numpy/pull/17457

1reaction
drew-parsonscommented, Aug 18, 2020

Confirmed, still failing with numpy 1.91.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

numpy.ediff1d — NumPy v1.24 Manual
The differences between consecutive elements of an array. Parameters: aryarray_like. If necessary, will be flattened before the differences are taken. to_end ...
Read more >
I have a Python error when importing the numpy module
I have installed numpy and all other modules needed using pip in the commandprompt. But I still get a error, I've tried to...
Read more >
NumPy: doc/changelog/1.19.0-changelog.rst | Fossies
#15115: MAINT: random: Remove a few unused imports from test files. #15116: MAINT: Bump pytest from 5.3.1 to 5.3.2; #15118: API: remove undocumented...
Read more >
jax.numpy.ediff1d - JAX documentation - Read the Docs
Original docstring below. Parameters. ary (array_like) – If necessary, will be flattened before the differences are taken. to_end (array_like ...
Read more >
Astropy Documentation - Read the Docs
You will need a compiler suite and the development headers for Python and Numpy in order to build Astropy. On. Linux, using the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found