Skip to content

Commit cf4b0c3

Browse files
authored
Revert "using Requires for Statistics (#255)" (#281)
This reverts commit 51b1838.
1 parent fd859c7 commit cf4b0c3

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ version = "0.9.0-dev"
44

55
[deps]
66
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
7-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
87
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
98

109
[compat]
11-
Requires = "1"
1210
julia = "1"
1311

1412
[extras]

src/FixedPointNumbers.jl

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Base: ==, <, <=, -, +, *, /, ~, isapprox,
99
signed, unsigned, copysign, flipsign, signbit,
1010
length
1111

12-
using Requires
12+
import Statistics # for _mean_promote
1313
import Random: Random, AbstractRNG, SamplerType, rand!
1414

1515
import Base.Checked: checked_neg, checked_abs, checked_add, checked_sub, checked_mul,
@@ -557,6 +557,10 @@ Base.mul_prod(x::FixedPoint, y::FixedPoint) = Treduce(x) * Treduce(y)
557557
Base.reduce_empty(::typeof(Base.mul_prod), ::Type{F}) where {F<:FixedPoint} = one(Treduce)
558558
Base.reduce_first(::typeof(Base.mul_prod), x::FixedPoint) = Treduce(x)
559559

560+
if isdefined(Statistics, :_mean_promote)
561+
Statistics._mean_promote(x::Real, y::FixedPoint) = Treduce(y)
562+
end
563+
560564
"""
561565
sd, ad = scaledual(s::Number, a)
562566
@@ -625,20 +629,4 @@ if VERSION >= v"1.1" # work around https://github.com/JuliaLang/julia/issues/341
625629
_precompile_()
626630
end
627631

628-
@static if VERSION >= v"1.9.0-DEV.873"
629-
function __init__()
630-
# Statistics and SparseArrays are moved out from sysimage
631-
# https://github.com/JuliaLang/julia/pull/44247#issuecomment-1172847231
632-
@require Statistics="10745b16-79ce-11e8-11f9-7d13ad32a3b2" begin
633-
Statistics._mean_promote(x::Real, y::FixedPoint) = Treduce(y)
634-
end
635-
end
636-
else
637-
import Statistics
638-
if isdefined(Statistics, :_mean_promote)
639-
# https://github.com/JuliaMath/FixedPointNumbers.jl/pull/183
640-
Statistics._mean_promote(x::Real, y::FixedPoint) = Treduce(y)
641-
end
642-
end
643-
644632
end # module

0 commit comments

Comments
 (0)