Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump deps #34

Merged
merged 4 commits into from
Sep 8, 2021
Merged

Bump deps #34

merged 4 commits into from
Sep 8, 2021

Conversation

t-bltg
Copy link
Member

@t-bltg t-bltg commented Sep 7, 2021

No description provided.

@t-bltg
Copy link
Member Author

t-bltg commented Sep 7, 2021

@mateuszbaran, any idea why the tests fails now, and how we can fix this ?

cc @johnnychen94 who might know ColorTypes or ColorVectorSpace better than me.

Macros: Error During Test at /home/runner/work/VisualRegressionTests.jl/VisualRegressionTests.jl/src/macros.jl:18
  Test threw exception
  Expression: test_images(testFilename, "PlotTest.png", popup = !istravis, tol = 0.02) |> success
  MethodError: no method matching +(::Float64, ::RGB{Float64})
  Math on colors is deliberately undefined in ColorTypes, but see the ColorVectorSpace package.
  Closest candidates are:
    +(::Any, ::Any, !Matched::Any, !Matched::Any...) at operators.jl:560
    +(::Union{Float16, Float32, Float64}, !Matched::BigFloat) at mpfr.jl:392
    +(!Matched::AbstractRGB, ::AbstractRGB) at /home/runner/.julia/packages/ColorVectorSpace/s7hKD/src/ColorVectorSpace.jl:262
    ...
  Stacktrace:
    [1] sumdiff
      @ ~/work/VisualRegressionTests.jl/VisualRegressionTests.jl/src/utils.jl:34 [inlined]
    [2] sad
      @ ~/work/VisualRegressionTests.jl/VisualRegressionTests.jl/src/utils.jl:26 [inlined]
    [3] blurdiff(A::Matrix{RGB{FixedPointNumbers.N0f8}}, B::Matrix{RGB{FixedPointNumbers.N0f8}}, sigma::Tuple{Int64, Int64})
      @ VisualRegressionTests ~/work/VisualRegressionTests.jl/VisualRegressionTests.jl/src/utils.jl:19
    [4] compare_images(testfn::String, reffn::String; sigma::Tuple{Int64, Int64}, tol::Float64)
      @ VisualRegressionTests ~/work/VisualRegressionTests.jl/VisualRegressionTests.jl/src/imgcomp.jl:15
    [5] test_images(testfn::String, reffn::String; popup::Bool, newfn::String, kw::Base.Iterators.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:tol,), Tuple{Float64}}})
      @ VisualRegressionTests ~/work/VisualRegressionTests.jl/VisualRegressionTests.jl/src/imgcomp.jl:31
    [6] macro expansion
      @ ~/work/VisualRegressionTests.jl/VisualRegressionTests.jl/src/macros.jl:18 [inlined]
    [7] macro expansion
      @ ~/work/VisualRegressionTests.jl/VisualRegressionTests.jl/test/runtests.jl:29 [inlined]
    [8] macro expansion
      @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
    [9] macro expansion
      @ ~/work/VisualRegressionTests.jl/VisualRegressionTests.jl/test/runtests.jl:27 [inlined]
   [10] macro expansion
      @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
   [11] top-level scope
      @ ~/work/VisualRegressionTests.jl/VisualRegressionTests.jl/test/runtests.jl:18

@mateuszbaran
Copy link

I would guess that you should replace abs with norm in

sad(A::AbstractArray, B::AbstractArray) = sumdiff(abs, A, B)
.

@johnnychen94
Copy link

There are some hard landings here for the recent CVS development, one of the major breaking change is that abs and abs2 are undefined for RGB types JuliaGraphics/ColorVectorSpace.jl#131. I would suggest drop all ColorTypes and ColorVectorSpace dependency, and use [email protected] instead; [email protected] reexports ColorTypes and also loads CVS 0.9.

To upgrade the codebase to [email protected], one needs to define his own _abs method, https://github.com/JuliaGraphics/ColorVectorSpace.jl#abs-and-abs2, and then replace sumdiff(abs, A, B) with sumdiff(_abs, A, B).

@t-bltg
Copy link
Member Author

t-bltg commented Sep 8, 2021

There are some hard landings here for the recent CVS development, one of the major breaking change is that abs and abs2 are undefined for RGB types JuliaGraphics/ColorVectorSpace.jl#131. I would suggest drop all ColorTypes and ColorVectorSpace dependency, and use [email protected] instead; [email protected] reexports ColorTypes and also loads CVS 0.9.

To upgrade the codebase to [email protected], one needs to define his own _abs method, https://github.com/JuliaGraphics/ColorVectorSpace.jl#abs-and-abs2, and then replace sumdiff(abs, A, B) with sumdiff(_abs, A, B).

Thanks for taking the time to answer, very clear.

@t-bltg t-bltg force-pushed the t-bltg-patch-2 branch 9 times, most recently from 29d377a to 794567f Compare September 8, 2021 09:21
@johnnychen94
Copy link

Images dependency might be too large for this package; and Images isn't yet compatible with CVS 0.9 yet so you might get a fake fix by adding Images dependency.

@t-bltg
Copy link
Member Author

t-bltg commented Sep 8, 2021

Images dependency might be too large for this package; and Images isn't yet compatible with CVS 0.9 yet so you might get a fake fix by adding Images dependency.

The reason why I'm trying to add Images is that the implementation of maxabsfinite was failing here, should I copy the whole code for maxabsfinite of https://github.com/JuliaImages/Images.jl/blob/master/src/algorithms.jl here ?.

Is there a reason why these algorithms are not in ImageCore instead ?

It's cumbersome:

@johnnychen94
Copy link

Ah okay, that now lives in ImageBase v0.1.3

ImageCore is designed to be a collection of traits and array types so we don't add many functions there.

@johnnychen94
Copy link

See also JuliaImages/ImageBase.jl#14

@t-bltg
Copy link
Member Author

t-bltg commented Sep 8, 2021

Ah okay, that now lives in ImageBase v0.1.3

Oh thanks for pointing ImageBase.

@t-bltg t-bltg force-pushed the t-bltg-patch-2 branch 8 times, most recently from 0f1e84f to da80d91 Compare September 8, 2021 10:12
@t-bltg
Copy link
Member Author

t-bltg commented Sep 8, 2021

God, that took an awful number of runs to get fixed for an equivalent 2 lines change.
I forgot how nasty colors and images can be, definitely not my expertise area.
I'm glad people like @johnnychen94 eat this at beakfast 😆

@t-bltg t-bltg merged commit 9a7bf9c into master Sep 8, 2021
@t-bltg t-bltg deleted the t-bltg-patch-2 branch September 8, 2021 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants