Closed ianthomas23 closed 1 year ago
Merging #1179 (efb55d0) into main (d8167b4) will increase coverage by
0.00%
. The diff coverage is75.00%
.
@@ Coverage Diff @@
## main #1179 +/- ##
=======================================
Coverage 85.38% 85.38%
=======================================
Files 35 35
Lines 8011 8012 +1
=======================================
+ Hits 6840 6841 +1
Misses 1171 1171
Impacted Files | Coverage Δ | |
---|---|---|
datashader/transfer_functions/__init__.py | 86.91% <75.00%> (+0.02%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
See issue #1178.
When using
cudf
, a categorical aggregate,how='eq_hist'
andrescale_discrete_levels=True
then categorical shading raises an error when trying to convert a tuple that contains acupy
array and scalar to acupy
array.The simplest possible fix would have been in
_rescale_discrete_levels()
here: https://github.com/holoviz/datashader/blob/d8167b41577058abe01ae1b847a5178ae6ccf172/datashader/transfer_functions/__init__.py#L230-L232 by castinglower_span
to afloat
. This is fine iflower_span
ia a scalar ornumpy
array, but if it is acupy
array then this would transfer it from GPU to CPU memory, only to be pushed back to the GPU subsequently. The solution here is to convert the span from tuple tonumpy
/cupy
array usinghstack
in_interpolate_alpha
.This fixes the error produced by the OP's example code, but there is still a problem in
holoviews
not displaying the categorical legend if using the GPU. I will create a separateholoviews
issue for this.