holoviz / datashader

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

Use enum for row index column rather than None #1234

Closed ianthomas23 closed 1 year ago

ianthomas23 commented 1 year ago

Internally within Datashader we pass around column string names to identify which columns of the source (e.g. DataFrame) need to be passed to the low-level numba functions. Up until now we have used None to represent either no column, which would apply to an any() reduction, or a virtual row index column for reductions like where. The multiple use of None for both is confusing, so this PR introduces a new Enum for RowIndex so that it is easy to identify this being different from None representing no column required.

External API is not changed.

codecov[bot] commented 1 year ago

Codecov Report

Merging #1234 (7d05e61) into main (3317542) will decrease coverage by 0.04%. The diff coverage is 75.00%.

@@            Coverage Diff             @@
##             main    #1234      +/-   ##
==========================================
- Coverage   83.56%   83.52%   -0.04%     
==========================================
  Files          35       35              
  Lines        8773     8777       +4     
==========================================
  Hits         7331     7331              
- Misses       1442     1446       +4     
Impacted Files Coverage Δ
datashader/reductions.py 78.63% <73.33%> (-0.24%) :arrow_down:
datashader/core.py 88.28% <100.00%> (ø)

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