Skip to content

Commit 208bc7e

Browse files
authored
Deprecate StatsBase (#135)
* Deprecate StatsBase * Mark an inferred test as broken
1 parent 42a9bf7 commit 208bc7e

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/ColorVectorSpace.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,6 @@ varm(v::AbstractArray{C}, s::AbstractGray; corrected::Bool=true) where {C<:Abstr
299299
varm(map(gray,v),gray(s); corrected=corrected)
300300
real(::Type{C}) where {C<:AbstractGray} = real(eltype(C))
301301

302-
#histrange for Gray type
303-
histrange(v::AbstractArray{Gray{T}}, n::Integer) where {T} = histrange(convert(Array{Float32}, map(gray, v)), n, :right)
304-
305302
# To help type inference
306303
promote_rule(::Type{T}, ::Type{C}) where {T<:Real,C<:AbstractGray} = promote_type(T, eltype(C))
307304

@@ -345,4 +342,12 @@ _precompile_()
345342
@deprecate (*)(A::AbstractArray{T}, b::TransparentGray) where {T<:Number} A.*b
346343
@deprecate (*)(b::TransparentGray, A::AbstractArray{T}) where {T<:Number} A.*b
347344

345+
## Deprecations
346+
347+
## From 2020-Sept-9
348+
# Since ImageContrastAdjustment is now doing its own binning, I think this can be safely deprecated and we can eliminate
349+
# the dependency on StatsBase.
350+
import StatsBase: histrange
351+
@deprecate histrange(v::AbstractArray{Gray{T}}, n::Integer) where {T} histrange(convert(Array{Float32}, map(gray, v)), n, :right)
352+
348353
end

test/runtests.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,11 @@ end
374374

375375
@testset "Colors issue #326" begin
376376
A = rand(RGB{N0f8}, 2, 2)
377-
@test @inferred mean(A) == mean(map(c->mapc(FixedPointNumbers.Treduce, c), A))
377+
if VERSION >= v"1.5"
378+
@test_broken @inferred mean(A) == mean(map(c->mapc(FixedPointNumbers.Treduce, c), A))
379+
else
380+
@test @inferred mean(A) == mean(map(c->mapc(FixedPointNumbers.Treduce, c), A))
381+
end
378382
end
379383
end
380384

0 commit comments

Comments
 (0)