From 09d8cc7ef615b8a924dd047d225a7429438ebad3 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Wed, 15 Apr 2020 07:52:24 -0500 Subject: [PATCH 1/2] Fix some `data`->`arraydata` depwarns --- src/ImageMetadata.jl | 2 +- src/operators.jl | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ImageMetadata.jl b/src/ImageMetadata.jl index c5a51e2..c3954ac 100644 --- a/src/ImageMetadata.jl +++ b/src/ImageMetadata.jl @@ -266,7 +266,7 @@ AxisArrays.axisvalues(img::ImageMetaAxis) = axisvalues(arraydata(img)) Extract the properties dictionary `props` for `imgmeta`. `props` shares storage with `img`, so changes to one affect the other. -See also: [`data`](@ref). +See also: [`arraydata`](@ref). """ properties(img::ImageMeta) = getfield(img, :properties) diff --git a/src/operators.jl b/src/operators.jl index 74ff171..f6c5930 100644 --- a/src/operators.jl +++ b/src/operators.jl @@ -27,29 +27,29 @@ _imagemeta(out) = out @inline _imagemeta(out, A, As...) = _imagemeta(out, As...) -(-)(img::ImageMeta) = shareproperties(img, -data(img)) +(-)(img::ImageMeta) = shareproperties(img, -arraydata(img)) batch2 = (:+, :-) for op in batch2 @eval begin - ($op)(img::ImageMeta, B::BitArray) = shareproperties(img, ($op)(data(img), B)) - ($op)(B::BitArray, img::ImageMeta) = shareproperties(img, ($op)(B, data(img))) + ($op)(img::ImageMeta, B::BitArray) = shareproperties(img, ($op)(arraydata(img), B)) + ($op)(B::BitArray, img::ImageMeta) = shareproperties(img, ($op)(B, arraydata(img))) ($op)(img::ImageMeta, B::ImageMeta) = ambigop(Symbol($op)) - ($op)(img::ImageMeta, B::AbstractArray) = shareproperties(img, ($op)(data(img), B)) - ($op)(B::AbstractArray, img::ImageMeta) = shareproperties(img, ($op)(B, data(img))) + ($op)(img::ImageMeta, B::AbstractArray) = shareproperties(img, ($op)(arraydata(img), B)) + ($op)(B::AbstractArray, img::ImageMeta) = shareproperties(img, ($op)(B, arraydata(img))) end for CV in (:AbstractGray, :TransparentGray, :AbstractRGB, :TransparentRGB) @eval begin ($op)(img::ImageMeta{CV}, n::$CV) where {CV<:$CV} = - shareproperties(img, ($op)(data(img), n)) + shareproperties(img, ($op)(arraydata(img), n)) ($op)(n::$CV, img::ImageMeta{CV}) where {CV<:$CV} = - shareproperties(img, ($op)(n, data(img))) + shareproperties(img, ($op)(n, arraydata(img))) end end end -(/)(img::ImageMeta, n::Number) = shareproperties(img, data(img)/n) +(/)(img::ImageMeta, n::Number) = shareproperties(img, arraydata(img)/n) ambigop(s::Symbol) = error("$s with two ImageMeta arrays: dictionary choice is ambiguous") From 310dd38845aa836d2e2c1f7c8be743bd5c15a7d1 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Wed, 15 Apr 2020 07:56:47 -0500 Subject: [PATCH 2/2] Add test/Project.toml and release 0.9.1 --- Project.toml | 2 +- test/Project.toml | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/Project.toml diff --git a/Project.toml b/Project.toml index d3a8c12..38a99cf 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ImageMetadata" uuid = "bc367c6b-8a6b-528e-b4bd-a4b897500b49" -version = "0.9.0" +version = "0.9.1" [deps] AxisArrays = "39de3d68-74b9-583c-8d2d-e117c070f3a9" diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..2bb8dd9 --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,12 @@ +[deps] +AxisArrays = "39de3d68-74b9-583c-8d2d-e117c070f3a9" +ColorVectorSpace = "c3611d14-8923-5661-9e6a-0046d554d3a4" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +ImageAxes = "2803e5a7-5153-5ecf-9a86-9b4c37f5f5ac" +ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534" +IndirectArrays = "9b13fd28-a010-5f03-acff-a1bbcff69959" +OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +SimpleTraits = "699a6c99-e7fa-54fc-8d76-47d257e15c1d" +Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"