Skip to content

Commit 0b6ed9b

Browse files
authored
address #104 (#105)
1 parent 4970f07 commit 0b6ed9b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/stat/stat.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ minimum(f, x; threads = false) = Base.minimum(f, x)
88
minimum(x::AbstractArray{Union{Missing, T},1}; threads = false) where T <: Union{INTEGERS, FLOATS, TimeType}= isempty(x) ? throw(ArgumentError("empty arrays are not allowed")) : threads ? hp_minimum(identity, x) : stat_minimum(identity, x)
99
minimum(x; threads = false) = Base.minimum(x)
1010
# TODO not optimised for simd - threads option is useless here / it is here because we have it for other types of data
11-
maximum(f, x::AbstractVector{Union{Missing, T}}; threads = false) where T <: AbstractString = mapreduce(f, _stat_max_fun, x)
12-
minimum(f, x::AbstractVector{Union{Missing, T}}; threads = false) where T <: AbstractString = mapreduce(f, _stat_min_fun, x)
13-
maximum(x::AbstractVector{Union{Missing, T}}; threads = false) where T <: AbstractString = maximum(identity, x)
14-
minimum(x::AbstractVector{Union{Missing, T}}; threads = false) where T <: AbstractString = minimum(identity, x)
11+
# using Union{Missing, AbstractString} force to fall back to this definition for Vector{Missing} Julia >= 1.9
12+
if VERSION >= v"1.9"
13+
_TASM_14329 = Union{Missing, AbstractString}
14+
else
15+
_TASM_14329 = AbstractString
16+
end
17+
maximum(f, x::AbstractVector{Union{Missing, T}}; threads = false) where T <: _TASM_14329 = mapreduce(f, _stat_max_fun, x)
18+
minimum(f, x::AbstractVector{Union{Missing, T}}; threads = false) where T <: _TASM_14329 = mapreduce(f, _stat_min_fun, x)
19+
maximum(x::AbstractVector{Union{Missing, T}}; threads = false) where T <: _TASM_14329 = maximum(identity, x)
20+
minimum(x::AbstractVector{Union{Missing, T}}; threads = false) where T <: _TASM_14329 = minimum(identity, x)
1521

1622
sum(f, x::AbstractArray{Union{Missing, T},1}; threads = false) where T <: Union{INTEGERS, FLOATS} = isempty(x) ? throw(ArgumentError("empty arrays are not allowed")) : threads ? hp_sum(f, x) : stat_sum(f, x)
1723
sum(f, x; threads = false)=Base.sum(f, x)

0 commit comments

Comments
 (0)