Skip to content

Cupy test failures using eq_hist #1128

@ianthomas23

Description

@ianthomas23

Using current master (commit a1de2d5e) running cupy tests in test_transfer_functions.py there are test failures:

$ DATASHADER_TEST_GPU=1 pytest datashader/tests/test_transfer_functions.py
<snip>
datashader/tests/test_transfer_functions.py:503: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
datashader/transfer_functions/__init__.py:689: in shade
    return _interpolate(agg, cmap, how, alpha, span, min_alpha, name, rescale_discrete_levels)
datashader/transfer_functions/__init__.py:273: in _interpolate
    data = interpolater(data, mask)
datashader/transfer_functions/__init__.py:176: in eq_hist
    bin_centers = np.arange(vmin, vmax+1)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   TypeError: Implicit conversion to a NumPy array is not allowed. Please use `.get()` to construct a NumPy array explicitly.

cupy/_core/core.pyx:1397: TypeError
========================================================================== short test summary info ===========================================================================
FAILED datashader/tests/test_transfer_functions.py::test_shade[None-a-agg1] - TypeError: Implicit conversion to a NumPy array is not allowed. Please use `.get()` to constr...
FAILED datashader/tests/test_transfer_functions.py::test_shade_cmap_errors[agg1] - TypeError: Implicit conversion to a NumPy array is not allowed. Please use `.get()` to c...
FAILED datashader/tests/test_transfer_functions.py::test_shade_rescale_discrete_levels[False-d-agg1] - TypeError: Implicit conversion to a NumPy array is not allowed. Plea...
FAILED datashader/tests/test_transfer_functions.py::test_shade_rescale_discrete_levels[True-d-agg1] - TypeError: Implicit conversion to a NumPy array is not allowed. Pleas...
================================================================== 4 failed, 107 passed, 6 skipped in 9.38s ==================================================================

This is because the eq_hist function uses some numpy calls that should be replaced with equivalent cupy calls if the supplied data is in a cupy array.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions