Define array promotion rules
Fixes #273, but this will need to be tested extensively to avoid breakages. Better or more robust solutions are welcome!
This PR delegates the promote_type operation to the parent wherever possible, and wraps the OffsetArray type around the result.
After this:
julia> [ones(2), ones(2:3)]
2-element Vector{OffsetVector{Float64, Vector{Float64}}}:
[1.0, 1.0]
[1.0, 1.0]
julia> [OffsetArray(["a"], 2), OffsetArray([1], 3)]
2-element Vector{OffsetVector{T} where T}:
["a"]
[1]
Codecov Report
Merging #288 (3a9c563) into master (5eeae03) will decrease coverage by
0.34%. The diff coverage is80.00%.
@@ Coverage Diff @@
## master #288 +/- ##
==========================================
- Coverage 95.53% 95.19% -0.35%
==========================================
Files 5 5
Lines 426 437 +11
==========================================
+ Hits 407 416 +9
- Misses 19 21 +2
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/OffsetArrays.jl | 96.87% <80.00%> (-0.60%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 5eeae03...3a9c563. Read the comment docs.
Not necessary anymore, as the change has been reverted