holoviz / datashader

Quickly and accurately render even the largest data.
http://datashader.org
BSD 3-Clause "New" or "Revised" License
3.3k stars 365 forks source link

Return early in eq_hist() if all data masked out #1168

Closed ianthomas23 closed 1 year ago

ianthomas23 commented 1 year ago

Fixes #1166.

If pass an fully-masked array to eq_hist() function, return early with an array of NaNs. This avoids calculating the cumulative distribution function of no data and the resultant IndexError because the CDF has no contents.

Passes new test locally on both CPU and GPU.

codecov[bot] commented 1 year ago

Codecov Report

Merging #1168 (4398ff9) into main (73d3deb) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1168   +/-   ##
=======================================
  Coverage   85.40%   85.40%           
=======================================
  Files          35       35           
  Lines        7987     7989    +2     
=======================================
+ Hits         6821     6823    +2     
  Misses       1166     1166           
Impacted Files Coverage Δ
datashader/transfer_functions/__init__.py 86.81% <100.00%> (+0.04%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more