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 lookup predicates #584

Closed rafaqz closed 7 months ago

rafaqz commented 7 months ago

This PR adds a bunch of is____ methods to make it easier to check dimension properties - mostly for package devs at this stage.

Currently if you want to know if lookups are all regular you need something like:

if all(map(dims(A)) do d
    span(d) isa Regular
end)

With this PR you can do:

isregular(A)
# or
isragular(A, (X, Y))

And similar.

codecov-commenter commented 7 months ago

Codecov Report

Attention: 27 lines in your changes are missing coverage. Please review.

Comparison is base (f8f9e12) 87.85% compared to head (9495d49) 87.23%.

Files Patch % Lines
src/LookupArrays/predicates.jl 33.33% 22 Missing :warning:
src/Dimensions/predicates.jl 40.00% 3 Missing :warning:
src/LookupArrays/selector.jl 66.66% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #584 +/- ## ========================================== - Coverage 87.85% 87.23% -0.63% ========================================== Files 41 43 +2 Lines 3410 3446 +36 ========================================== + Hits 2996 3006 +10 - Misses 414 440 +26 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.