holoviz / datashader

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

CPU shift_and_insert function #1260

Closed ianthomas23 closed 11 months ago

ianthomas23 commented 11 months ago

Refactor of *_n reductions such as max_n so that all shift and insert functionality is in a single shift_and_insert function rather than repeated across the codebase. The new function takes a 1D array of length n (the n of the max_n or similar), the value to insert and the index to insert at. The function shifts alongs values from index onwards one along the array and inserts the value.

This is CPU only, GPU equivalent will follow in a separate PR.

codecov[bot] commented 11 months ago

Codecov Report

Merging #1260 (55de7b3) into main (81260ca) will decrease coverage by 0.02%. The diff coverage is 94.73%.

@@            Coverage Diff             @@
##             main    #1260      +/-   ##
==========================================
- Coverage   83.49%   83.48%   -0.02%     
==========================================
  Files          35       35              
  Lines        8955     8931      -24     
==========================================
- Hits         7477     7456      -21     
+ Misses       1478     1475       -3     
Files Changed Coverage Δ
datashader/reductions.py 78.05% <87.50%> (-0.09%) :arrow_down:
datashader/utils.py 82.71% <100.00%> (-0.20%) :arrow_down:

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