New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalize the element type of BlockedUnitRange
#337
Generalize the element type of BlockedUnitRange
#337
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## release-1.0 #337 +/- ##
===============================================
+ Coverage 95.42% 95.47% +0.05%
===============================================
Files 17 17
Lines 1530 1548 +18
===============================================
+ Hits 1460 1478 +18
Misses 70 70 ☔ View full report in Codecov by Sentry. |
Looks like there are some downstream test failures caused by adding an extra type parameter to |
Probably a non-breaking implementation needs to be in the non-standard form |
I’m thinking we tag v1 after this is done so it’s fine if it’s breaking |
I'm guessing that most use cases of |
Yes sorry I meant tag v1 once we also add BlockedOneTo |
BlockedUnitRange
BlockedUnitRange
I think this is ready for review. Some discussion points are:
|
|
There already appears to be a |
Gentle bump, could you rebase this on the updated |
Will do. |
@jishnub I merged the latest I assume we will want to generalize the element type of In the latest commit I made the type constraints of the inner julia> BlockArrays._BlockedUnitRange(UInt8(1), [1, 2, 3])
3-blocked 3-element BlockedUnitRange{Int64, Vector{Int64}}:
1
─
2
─
3
julia> BlockArrays._BlockedUnitRange(UInt8(1), (UInt8(1), 2, 3))
3-blocked 3-element BlockedUnitRange{Int64, Tuple{Int64, Int64, Int64}}:
1
─
2
─
3 whereas before the types of the fields |
I think this looks good at this point. There are some issues like |
Sounds good, I'll add some more tests to improve the coverage. |
Ok I think everything is covered now. |
Great, let's merge this and then figure out the other issues |
Fixes #336.
This is meant to be a minimal implementation that gets tests passing, there may be a few different design choices to make for certain functions. I also need to check that the element type is actually preserved appropriately, such as in functions like
blockfirsts
,blocklasts
, etc.I'm not sure what we want for
eltype(blocklengths(r))
(i.e. should it equaleltype(r)
orInt
?), sincelength(::AbstractUnitRange)
doesn't matcheltype(::AbstractUnitRange)
: