diff --git a/src/io.jl b/src/io.jl index f2a777a..96d3754 100644 --- a/src/io.jl +++ b/src/io.jl @@ -13,15 +13,8 @@ function par2ystr(par::AbstractParametersVector, txt::Vector{String}; show_info: end end -function equals_with_missing(a, b) - if ismissing(a) && ismissing(b) - return true - elseif ismissing(a) || ismissing(b) - return false - else - return a == b - end -end +# isequal treats missing==missing and NaN==NaN as true, unlike == +equals_with_missing(a, b) = isequal(a, b) function YAML._print(io::IO, value::Missing, level::Int=0, ignore_level::Bool=false) return println(io, "~") diff --git a/src/utils.jl b/src/utils.jl index 0c4f548..1da60a0 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -41,7 +41,7 @@ function Base.diff(p1::AbstractParametersVector, p2::AbstractParametersVector) end for key in commonkeys v1 = p1[key] - v2 = p1[key] + v2 = p2[key] if typeof(v1) !== typeof(v2) error("$key is of different type") elseif typeof(v1) <: AbstractParameters