JuliaFolds2 / ChunkSplitters.jl

Splitting collections into chunks
https://juliafolds2.github.io/ChunkSplitters.jl/
MIT License
50 stars 7 forks source link

Support `size>length(input)` #29

Closed carstenbauer closed 8 months ago

carstenbauer commented 8 months ago

Currently there is in inconsistency between n and size because the former allows n>length(input) but the latter doesn't. This PR changes this.

With this PR:

julia> chunks(1:10; size=10) |> collect
1-element Vector{StepRange{Int64, Int64}}:
 1:1:10

julia> chunks(1:10; size=100) |> collect
1-element Vector{StepRange{Int64, Int64}}:
 1:1:10

julia> chunks(1:10; size=1000) |> collect
1-element Vector{StepRange{Int64, Int64}}:
 1:1:10

The PR is non-breaking because this error'ed before.

(cc @MasonProtter)

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.12%. Comparing base (8c7b63c) to head (7edce29).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #29 +/- ## ========================================== + Coverage 94.14% 95.12% +0.97% ========================================== Files 2 2 Lines 222 205 -17 ========================================== - Hits 209 195 -14 + Misses 13 10 -3 ```

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

lmiq commented 8 months ago

This should be v3.4.0, right?

(tests are failing on 1.11.0-alpha1, but that's not our fault).

lmiq commented 8 months ago

I mean, 2.4.0

carstenbauer commented 8 months ago

Yes

lmiq commented 8 months ago

released as 2.4.0. Thanks.