Skip to content

Commit 19c99d8

Browse files
Update docstrings to reflect NaN (lack of) handling
1 parent 71724e2 commit 19c99d8

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/vfindminmax.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ of an array are not well-supported. A workaround is possible by reshaping `A` bu
3939
the resultant performance is often only on par with `findmax`. As a temporary convenience,
4040
`findmax1` is provided for explicit uses of the re-shaping strategy, though the user
4141
is cautioned as to the performance problems.
42+
43+
# Warning
44+
`NaN` values are not handled!
4245
"""
4346
vfindmax(f::F, A, dims) where {F<:Function} = vfindminmax(f, >, typemin, A, dims)
4447

@@ -55,6 +58,9 @@ of an array are not well-supported. A workaround is possible by reshaping `A` bu
5558
the resultant performance is often only on par with `findmin`. As a temporary convenience,
5659
`findmin1` is provided for explicit uses of the re-shaping strategy, though the user
5760
is cautioned as to the performance problems.
61+
62+
# Warning
63+
`NaN` values are not handled!
5864
"""
5965
vfindmin(f::F, A, dims) where {F<:Function} = vfindminmax(f, <, typemax, A, dims)
6066

@@ -384,6 +390,10 @@ dimensions `dims`, which may be `::Int`, `::NTuple{M, Int} where {M}` or `::Colo
384390
Threaded.
385391
386392
See also: [`vfindmax`](@ref)
393+
394+
# Warning
395+
`NaN` values are not handled!
396+
387397
"""
388398
vtfindmax(f::F, A, dims) where {F<:Function} = vtfindminmax(f, >, typemin, A, dims)
389399

@@ -395,6 +405,9 @@ dimensions `dims`, which may be `::Int`, `::NTuple{M, Int} where {M}` or `::Colo
395405
Threaded.
396406
397407
See also: [`vfindmin`](@ref)
408+
409+
# Warning
410+
`NaN` values are not handled!
398411
"""
399412
vtfindmin(f::F, A, dims) where {F<:Function} = vtfindminmax(f, <, typemax, A, dims)
400413
# ::AbstractArray required in order for kwargs interface to work

src/vmapreduce.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,19 @@ vvprod(f::F, A, dims) where {F} = vvmapreduce(f, *, one, A, dims)
6868
vvmaximum(f, A::AbstractArray, dims=:)
6969
7070
Compute the maximum value by calling `f` on each element of `A` over the given `dims`.
71+
72+
# Warning
73+
`NaN` values are not handled!
7174
"""
7275
vvmaximum(f::F, A, dims) where {F} = vvmapreduce(f, max, typemin, A, dims)
7376

7477
"""
7578
vvminimum(f, A::AbstractArray, dims=:)
7679
7780
Compute the minimum value by calling `f` on each element of `A` over the given `dims`.
81+
82+
# Warning
83+
`NaN` values are not handled!
7884
"""
7985
vvminimum(f::F, A, dims) where {F} = vvmapreduce(f, min, typemax, A, dims)
8086

@@ -130,6 +136,9 @@ vvminimum(A::AbstractArray) = vvmapreduce(identity, min, typemax, A, :)
130136
131137
Compute the minimum and maximum values by calling `f` on each element of of `A`
132138
over the given `dims`.
139+
140+
# Warning
141+
`NaN` values are not handled!
133142
"""
134143
vvextrema(f::F, A, dims) where {F} = collect(zip(vvminimum(f, A, dims), vvmaximum(f, A, dims)))
135144
vvextrema(f::F, A, ::Colon) where {F} = (vvminimum(f, A, :), vvmaximum(f, A, :))
@@ -632,13 +641,19 @@ vtprod(f::F, A, dims) where {F} = vtmapreduce(f, *, one, A, dims)
632641
vtmaximum(f, A::AbstractArray, dims=:)
633642
634643
Compute the maximum value by calling `f` on each element of `A` over the given `dims`.
644+
645+
# Warning
646+
`NaN` values are not handled!
635647
"""
636648
vtmaximum(f::F, A, dims) where {F} = vtmapreduce(f, max, typemin, A, dims)
637649

638650
"""
639651
vtminimum(f, A::AbstractArray, dims=:)
640652
641653
Compute the minimum value by calling `f` on each element of `A` over the given `dims`.
654+
655+
# Warning
656+
`NaN` values are not handled!
642657
"""
643658
vtminimum(f::F, A, dims) where {F} = vtmapreduce(f, min, typemax, A, dims)
644659

@@ -688,6 +703,9 @@ vtminimum(A::AbstractArray) = vtmapreduce(identity, min, typemax, A, :)
688703
689704
Compute the minimum and maximum values by calling `f` on each element of of `A`
690705
over the given `dims`.
706+
707+
# Warning
708+
`NaN` values are not handled!
691709
"""
692710
vtextrema(f::F, A, dims) where {F} = collect(zip(vtminimum(f, A, dims), vtmaximum(f, A, dims)))
693711
vtextrema(f::F, A, ::Colon) where {F} = (vtminimum(f, A, :), vtmaximum(f, A, :))

0 commit comments

Comments
 (0)