SimonTreillou / TaylorDiag.jl

Github repo about Taylor diagram implementation in Julia.
MIT License
7 stars 0 forks source link

DomainError for code example #3

Closed cbsteh closed 2 years ago

cbsteh commented 2 years ago

I am getting the following error message using your code example:

ERROR: DomainError with 1.2266298878305306:
acos(x) not defined for |x| > 1
Stacktrace:
  [1] acos_domain_error(x::Float64)
    @ Base.Math .\special\trig.jl:669
  [2] acos(x::Float64)
    @ Base.Math .\special\trig.jl:699
  [3] _broadcast_getindex_evalf
    @ .\broadcast.jl:670 [inlined]
  [4] _broadcast_getindex
    @ .\broadcast.jl:643 [inlined]
  [5] _getindex
    @ .\broadcast.jl:667 [inlined]
  [6] _broadcast_getindex
    @ .\broadcast.jl:642 [inlined]
  [7] getindex
    @ .\broadcast.jl:597 [inlined]
  [8] macro expansion
    @ .\broadcast.jl:961 [inlined]
  [9] macro expansion
    @ .\simdloop.jl:77 [inlined]
 [10] copyto!
    @ .\broadcast.jl:960 [inlined]
 [11] copyto!
    @ .\broadcast.jl:913 [inlined]
 [12] copy
    @ .\broadcast.jl:885 [inlined]
 [13] materialize
    @ .\broadcast.jl:860 [inlined]
 [14] to_polar(C::Vector{Float64})
    @ TaylorDiag C:\Users\Admin\.julia\packages\TaylorDiag\tP0kR\src\utils.jl:16
 [15] taylordiagram(S::Vector{Float64}, C::Vector{Float64}, names::Vector{Float64}; figsize::Int64, dpi::Int64, pointcolor::Symbol, pointfontsize::Int64, correlationcolor::Symbol, freRMS::Int64)
    @ TaylorDiag C:\Users\Admin\.julia\packages\TaylorDiag\tP0kR\src\taylor.jl:10
 [16] taylordiagram(S::Vector{Float64}, C::Vector{Float64}, names::Vector{Float64})
    @ TaylorDiag C:\Users\Admin\.julia\packages\TaylorDiag\tP0kR\src\taylor.jl:6
 [17] top-level scope
    @ d:\OneDrive\Julia\TaylorDiagram\src\test.jl:19
SimonTreillou commented 2 years ago

Hello @cbsteh, thank you for reviewing my package. The bug has been fixed with commit 327a066. The first implementation of the taylordiagram function used 3 main arguments: S (standard deviations), R (RMSD) and C (correlation coefficients). As the R collection wasn't necessary, I removed it from the list of arguments but forgot to update the example (that's why there was correlation coefficients higher than 1 !). Thank you for your issue !