Skip to content

Commit bdd9c0e

Browse files
Merge pull request #50 from juliangehring/develop
Merge changes for v0.2.3
2 parents ef502ba + 167fc6d commit bdd9c0e

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# MultipleTesting.jl News and Changes
22

3+
## Version 0.2.3
4+
5+
### Changes
6+
7+
- Switch to new `Weights` type in 'StatsBase' (>= v0.15.0)
8+
9+
310
## Version 0.2.2
411

512
### Changes

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
julia 0.5
2-
StatsBase
2+
StatsBase 0.15.0
33
Distributions
44
Compat 0.19.0

src/combinations.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
combine{T<:AbstractFloat, M<:PValueCombination}(pValues::AbstractVector{T}, method::M) = combine(PValues(pValues), method)
44

5-
combine{T<:AbstractFloat, M<:PValueCombination}(pValues::AbstractVector{T}, weights::WeightVec, method::M) = combine(PValues(pValues), weights, method)
5+
combine{T<:AbstractFloat, M<:PValueCombination}(pValues::AbstractVector{T}, weights::Weights, method::M) = combine(PValues(pValues), weights, method)
66

77
combine{T<:AbstractFloat, R<:Real, M<:PValueCombination}(pValues::AbstractVector{T}, weights::AbstractVector{R}, method::M) = combine(PValues(pValues), weights, method)
88

@@ -68,7 +68,7 @@ function combine{T<:AbstractFloat}(pValues::PValues{T}, weights::Vector{T}, meth
6868
stouffer_combination(pValues, weights)
6969
end
7070

71-
function combine{T<:AbstractFloat}(pValues::PValues{T}, weights::WeightVec, method::StoufferCombination)
71+
function combine{T<:AbstractFloat}(pValues::PValues{T}, weights::Weights, method::StoufferCombination)
7272
stouffer_combination(pValues, values(weights))
7373
end
7474

test/test-combinations.jl

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,35 +139,32 @@ using Base.Test
139139

140140
method = StoufferCombination
141141

142-
# `WeightVec` and `weights` are the same
143-
@test WeightVec(w3) weights(w3)
144-
145142
ref = ref1[method]
146143
@test isapprox( combine(p1, ones(p1), method()), ref, atol = 1e-8)
147-
@test isapprox( combine(p1, weights(ones(p1)), method()), ref, atol = 1e-8)
148-
@test isapprox( combine(PValues(p1), weights(ones(p1)), method()), ref, atol = 1e-8)
144+
@test isapprox( combine(p1, Weights(ones(p1)), method()), ref, atol = 1e-8)
145+
@test isapprox( combine(PValues(p1), Weights(ones(p1)), method()), ref, atol = 1e-8)
149146

150147
ref = ref2[method]
151148
@test isapprox( combine(p2, ones(p2), method()), ref, atol = 1e-8)
152-
@test isapprox( combine(p2, weights(ones(p2)), method()), ref, atol = 1e-8)
153-
@test isapprox( combine(PValues(p2), weights(ones(p2)), method()), ref, atol = 1e-8)
149+
@test isapprox( combine(p2, Weights(ones(p2)), method()), ref, atol = 1e-8)
150+
@test isapprox( combine(PValues(p2), Weights(ones(p2)), method()), ref, atol = 1e-8)
154151

155152
ref = ref3[method]
156153
w3norm = w3 ./ sum(w3)
157154
# unnormalised weights
158155
@test isapprox( combine(p3, w3, method()), ref, atol = 1e-8 )
159-
@test isapprox( combine(p3, weights(w3), method()), ref, atol = 1e-8 )
156+
@test isapprox( combine(p3, Weights(w3), method()), ref, atol = 1e-8 )
160157
# normalised weights
161158
@test isapprox( combine(p3, w3norm, method()), ref, atol = 1e-8 )
162-
@test isapprox( combine(p3, weights(w3norm), method()), ref, atol = 1e-8 )
159+
@test isapprox( combine(p3, Weights(w3norm), method()), ref, atol = 1e-8 )
163160

164161
@test_throws DomainError combine(p1_invalid, ones(p1_invalid), method())
165-
@test_throws DomainError combine(p1_invalid, weights(ones(p1_invalid)), method())
162+
@test_throws DomainError combine(p1_invalid, Weights(ones(p1_invalid)), method())
166163
@test_throws DomainError combine(p2_invalid, ones(p2_invalid), method())
167-
@test_throws DomainError combine(p2_invalid, weights(ones(p2_invalid)), method())
164+
@test_throws DomainError combine(p2_invalid, Weights(ones(p2_invalid)), method())
168165

169166
@test combine(p_single, ones(p_single), method()) == p_single[1]
170-
@test combine(p_single, weights(ones(p_single)), method()) == p_single[1]
167+
@test combine(p_single, Weights(ones(p_single)), method()) == p_single[1]
171168

172169
end
173170

0 commit comments

Comments
 (0)