JuliaImages / ImageFiltering.jl

Julia implementations of multidimensional array convolution and nonlinear stencil operations
Other
99 stars 49 forks source link

Patches `padarray` so that it works on `OffsetArray` #61

Closed zygmuntszpak closed 6 years ago

zygmuntszpak commented 6 years ago

Using the padarray function with the Fill type on an OffsetArray resulted in an error. This was caused due to an implicit call of size on an OffsetArray which is an undefined operation. This commit patches the bug JuliaImages/Images.jl/issues/718

codecov[bot] commented 6 years ago

Codecov Report

Merging #61 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
+ Coverage    91.5%   91.51%   +<.01%     
==========================================
  Files           8        8              
  Lines        1095     1096       +1     
==========================================
+ Hits         1002     1003       +1     
  Misses         93       93
Impacted Files Coverage Δ
src/border.jl 96.89% <100%> (+0.01%) :arrow_up:

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 e808ec8...a054872. Read the comment docs.

zygmuntszpak commented 6 years ago

I've changed it to your suggestion, but I'm wondering why we ought to use Compat.axes and not OffsetArrays.axes in this instance?

Evizero commented 6 years ago

Because as far as I can tell that's where the axes actually comes from. OffsetArrays.axes works because that package also uses that function. As I understand axes is the 0.7 version of indices, so for backward compatibility Compat provides some glue code to also make it work in 0.6. It seems in 0.6 its just a reference to indices

at least thats my impression when looking at https://github.com/JuliaArrays/OffsetArrays.jl/commit/ce854a71a9e96eba081d48144b9df66928ebdc91