rafaqz / DimensionalData.jl

Named dimensions and indexing for julia arrays and other data
https://rafaqz.github.io/DimensionalData.jl/stable/
MIT License
269 stars 37 forks source link

add a cyclic lookup #565

Closed rafaqz closed 9 months ago

rafaqz commented 9 months ago

This PR adds a Cyclic lookup type that modifies selectors to cycle the lookup below and above its range.

This works for At, Near and Contains

I'm not yet sure how to support ... It probably needs to return a Vector{Int} but that would need special handling to have the correct Ordered unrolled cyclic lookup afterwards rather than just repeats of the cycle.

codecov-commenter commented 9 months ago

Codecov Report

Merging #565 (6764c16) into main (b20aeb0) will increase coverage by 0.17%. Report is 1 commits behind head on main. The diff coverage is 96.42%.

@@            Coverage Diff             @@
##             main     #565      +/-   ##
==========================================
+ Coverage   87.94%   88.11%   +0.17%     
==========================================
  Files          40       40              
  Lines        3334     3383      +49     
==========================================
+ Hits         2932     2981      +49     
  Misses        402      402              
Files Coverage Δ
src/LookupArrays/LookupArrays.jl 100.00% <ø> (ø)
src/LookupArrays/lookup_traits.jl 97.72% <ø> (ø)
src/LookupArrays/selector.jl 87.09% <100.00%> (+0.27%) :arrow_up:
src/LookupArrays/show.jl 84.72% <100.00%> (ø)
src/LookupArrays/lookup_arrays.jl 85.86% <95.65%> (+2.19%) :arrow_up:

... and 2 files with indirect coverage changes

:mega: Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!