JuliaArrays / OffsetArrays.jl

Fortran-like arrays with arbitrary, zero or negative starting indices.
Other
198 stars 40 forks source link

Add similar(::Type{<:OffsetArray}, axes) #264

Closed jishnub closed 3 years ago

jishnub commented 3 years ago

Fixes #263 by replacing O::Type{<:OffsetArray} with Array{eltype(O)} in similar.

I'm not too sure about this, as eltype may not be inferred in general, and the similar method doesn't work for arbitrary types anyway. However this might be useful in certain cases.

codecov[bot] commented 3 years ago

Codecov Report

Merging #264 (8eb1d2c) into master (aa21e43) will increase coverage by 0.02%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #264      +/-   ##
==========================================
+ Coverage   96.34%   96.37%   +0.02%     
==========================================
  Files           5        5              
  Lines         438      441       +3     
==========================================
+ Hits          422      425       +3     
  Misses         16       16              
Impacted Files Coverage Δ
src/OffsetArrays.jl 98.33% <100.00%> (+0.01%) :arrow_up:
src/axes.jl 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update aa21e43...8eb1d2c. Read the comment docs.