Skip to content

Commit

Permalink
Set ImageCore compatibility to 0.9 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnychen94 authored Aug 20, 2021
1 parent 6bb8fa4 commit a4924ce
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
7 changes: 4 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ SimpleTraits = "699a6c99-e7fa-54fc-8d76-47d257e15c1d"
[compat]
AxisArrays = "0.3, 0.4"
ImageBase = "0.1.1"
ImageCore = "0.8.1, 0.9"
ImageCore = "0.9"
Reexport = "0.2, 1.0"
SimpleTraits = "0.8, 0.9"
julia = "1"

[extras]
ColorVectorSpace = "c3611d14-8923-5661-9e6a-0046d554d3a4"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[targets]
test = ["ColorVectorSpace", "Unitful", "Test"]
test = ["Aqua", "Documenter", "Unitful", "Test"]
7 changes: 4 additions & 3 deletions src/ImageAxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ function ImageCore.channelview(A::AxisArray)
end
# without extra dimension:
_channelview(A::AxisArray{C,N}, Ac::AbstractArray{T,N}) where {C,T,N} = AxisArray(Ac, AxisArrays.axes(A)...)
# with extra dimension: (bug: the type parameters shouldn't be necessary, but julia 0.5 dispatches incorrectly without them)
_channelview(A::AxisArray{C,M}, Ac::AbstractArray{T,N}) where {C,T,M,N} = AxisArray(Ac, Axis{:color}(axes(Ac,1)), AxisArrays.axes(A)...)
# with extra dimension:
_channelview(A::AxisArray, Ac::AbstractArray) = AxisArray(Ac, Axis{:color}(axes(Ac,1)), AxisArrays.axes(A)...)


### Image properties based on traits ###
Expand Down Expand Up @@ -167,7 +167,6 @@ ImageCore.size_spatial(img::AxisArray) = filter_space_axes(AxisArrays.axes(im
ImageCore.indices_spatial(img::AxisArray) = filter_space_axes(AxisArrays.axes(img), axes(img))

arraydata(img::AxisArray) = img.data
@deprecate data arraydata

### Utilities for writing "simple algorithms" safely ###

Expand Down Expand Up @@ -442,6 +441,8 @@ function AxisArrays._summary(io, A::AxisArray{T,N}) where {T<:Union{Fractional,C
println(io, ",$N,...} with axes:")
end

include("deprecated.jl")

# glue codes
include("offsetarrays.jl")
include("restrict.jl")
Expand Down
5 changes: 5 additions & 0 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# BEGIN ImageAxes v0.6

@deprecate data arraydata # PR#31

# END ImageAxes v0.6
29 changes: 19 additions & 10 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
using Test, ImageCore
using ImageCore
using ImageCore.MappedArrays
using ImageCore.OffsetArrays
import AxisArrays
using ImageBase: restrict
using ColorVectorSpace

ambs = detect_ambiguities(ImageCore,AxisArrays,Base,Core)
using ImageAxes
ambs = setdiff(detect_ambiguities(ImageAxes,ImageCore,AxisArrays,Base,Core), ambs)
if !isempty(ambs)
println("Ambiguities:")
for a in ambs
println(a)
using Test, Aqua, Documenter # for meta quality checks

@testset "Project meta quality checks" begin
if VERSION >= v"1.2"
# Not checking compat section for test-only dependencies
ambiguity_exclude_list = [
# https://github.com/JuliaDiff/ChainRulesCore.jl/pull/367#issuecomment-869071000
Base.:(==),
]
Aqua.test_ambiguities([ImageAxes, Base, Core], exclude=ambiguity_exclude_list)
Aqua.test_all(ImageAxes;
ambiguities=false,
project_extras=true,
deps_compat=true,
stale_deps=true,
project_toml_formatting=true
)
DocMeta.setdocmeta!(ImageAxes, :DocTestSetup, :(using ImageAxes); recursive=true)
end
end
@test isempty(ambs)

using SimpleTraits, Unitful

Expand Down

0 comments on commit a4924ce

Please sign in to comment.