JuliaArrays / AxisArrays.jl

Performant arrays where each dimension can have a named axis with values
http://JuliaArrays.github.io/AxisArrays.jl/latest/
Other
200 stars 41 forks source link

extend `OffsetArrays.centered` for AxisArray #196

Closed johnnychen94 closed 3 years ago

johnnychen94 commented 3 years ago

ImageFiltering.centered is now moved to OffsetArrays.centered (https://github.com/JuliaArrays/OffsetArrays.jl/issues/169), this requires AxisArrays.jl to extend its method so that ImageFiltering is still working as usual.

The codes here originally live in https://github.com/JuliaImages/ImageFiltering.jl/blob/d4df16a6a130fa0f1573394172bb48e634b6e76a/src/ImageFiltering.jl#L96-L99

This change adds OffsetArrays as a dependency:

julia> @time using AxisArrays
# after: 0.252187 seconds (408.84 k allocations: 25.418 MiB, 3.28% gc time)
# before:  0.209274 seconds (329.24 k allocations: 19.370 MiB)

I do not have write permission to this repo so may need someone with write permission to review it. Or I could help do some regular maintenance on this package. cc: @mbauman @timholy

johnnychen94 commented 3 years ago

bump :)

codecov[bot] commented 3 years ago

Codecov Report

Merging #196 (5936d54) into master (28e9beb) will increase coverage by 0.03%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #196      +/-   ##
==========================================
+ Coverage   89.31%   89.34%   +0.03%     
==========================================
  Files           7        8       +1     
  Lines         674      676       +2     
==========================================
+ Hits          602      604       +2     
  Misses         72       72              
Impacted Files Coverage Δ
src/offsetarrays.jl 100.00% <100.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 28e9beb...5936d54. Read the comment docs.

johnnychen94 commented 3 years ago

For the record, to not adding an extra dependency to this package, I decided to add it in ImageAxes.jl for now (as a permitted pirate). We can go back when we have a first-class conditional loading mechanism.