From bd1d562c571a11a06654b76e8dfe9d6184abf82c Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Thu, 25 May 2017 12:51:25 +0200 Subject: [PATCH] Different implementation of the override --- src/Plots.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index 0f49b301..20c41ad1 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -106,11 +106,10 @@ export # --------------------------------------------------------- -import NaNMath # define functions (e.g. `_extrema`, that uses the NaNMath version (which ignores NaNs)) when the type is applicable for fun in (:extrema, :minimum, :maximum, :mean) - @eval $(Symbol(string("_",fun)))(x...) = Base.$(fun)(x...) - @eval $(Symbol(string("_",fun))){F <: AbstractFloat}(x::AbstractVector{F}) = NaNMath.$(fun)(x) + @eval $(Symbol(string("_",fun))){F<:AbstractFloat, N<:Integer}(x::AbstractArray{F, N}) = Base.$(fun)(filter(!isnan(x))) + @eval $(Symbol(string("_",fun)))(x) = Base.$(fun)(x) end # ---------------------------------------------------------