Skip to content

Commit ef502ba

Browse files
Merge pull request #47 from juliangehring/develop
Merge changes for v0.2.2
2 parents 5d3f4b5 + 0294044 commit ef502ba

File tree

6 files changed

+50
-19
lines changed

6 files changed

+50
-19
lines changed

.appveyor.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
environment:
22
matrix:
3-
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
4-
- JULIAVERSION: "julialang/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
5-
6-
matrix:
7-
allow_failures:
8-
- JULIAVERSION: "julialang/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
3+
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
4+
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
95

106
notifications:
117
- provider: Email
@@ -14,9 +10,10 @@ notifications:
1410
on_build_status_changed: false
1511

1612
install:
13+
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
1714
# Download most recent Julia Windows binary
1815
- ps: (new-object net.webclient).DownloadFile(
19-
$("http://s3.amazonaws.com/"+$env:JULIAVERSION),
16+
$env:JULIA_URL,
2017
"C:\projects\julia-binary.exe")
2118
# Run installer silently, output to C:\projects\julia
2219
- C:\projects\julia-binary.exe /S /D=C:\projects\julia

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ julia:
77
- 0.5
88
- 0.6
99

10-
matrix:
11-
allow_failures:
12-
- julia: 0.6
13-
1410
notifications:
1511
email:
1612
on_success: never

NEWS.md

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

3+
## Version 0.2.2
4+
5+
### Changes
6+
7+
- Makes the `PValues` type immutable and persistent
8+
- Finalises support of julia 0.6 with testing
9+
10+
11+
### Support
12+
13+
- Requires julia 0.5 or 0.6
14+
15+
316
## Version 0.2.1
417

518
### Changes

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MultipleTesting
22

3-
The `MultipleTesting` package offers common algorithms for p-value adjustment and the estimation of the proportion π₀ of true null hypotheses.
3+
The `MultipleTesting` package offers common algorithms for p-value adjustment and combination as well as the estimation of the proportion π₀ of true null hypotheses.
44

55
![xkcd p-value guide](pvalues.png)
66

@@ -118,7 +118,9 @@ The package is actively developed and uses [semantic versioning](http://semver.o
118118
119119
[![DOI](https://zenodo.org/badge/27935122.svg)](https://zenodo.org/badge/latestdoi/27935122)
120120
121+
[![Package Status](http://pkg.julialang.org/badges/MultipleTesting_0.6.svg)](http://pkg.julialang.org/?pkg=MultipleTesting)
121122
[![Package Status](http://pkg.julialang.org/badges/MultipleTesting_0.5.svg)](http://pkg.julialang.org/?pkg=MultipleTesting)
123+
122124
[![Linux/Mac Build Status](https://travis-ci.org/juliangehring/MultipleTesting.jl.svg?branch=master)](https://travis-ci.org/juliangehring/MultipleTesting.jl)
123125
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/1ld0ppptisirryt1/branch/master?svg=true)](https://ci.appveyor.com/project/juliangehring/multipletesting-jl/branch/master)
124126
[![Coverage Status](https://codecov.io/gh/juliangehring/MultipleTesting.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/juliangehring/MultipleTesting.jl)

src/types.jl

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

1414
## PValues
1515

16-
type PValues{T<:AbstractFloat} <: AbstractVector{T}
16+
immutable PValues{T<:AbstractFloat} <: AbstractVector{T}
1717
values::AbstractVector{T}
1818
min::T
1919
max::T
@@ -23,7 +23,7 @@ type PValues{T<:AbstractFloat} <: AbstractVector{T}
2323
if min < 0.0 || max > 1.0
2424
throw(DomainError())
2525
end
26-
new{T}(values, min, max)
26+
new{T}(copy(values), min, max)
2727
end
2828
end
2929

@@ -32,6 +32,8 @@ Base.convert{T<:AbstractFloat}(::Type{PValues}, x::AbstractVector{T}) = PValues(
3232
Base.size(pv::PValues) = (length(pv.values), )
3333
@compat Base.IndexStyle{T<:PValues}(::Type{T}) = IndexLinear()
3434
Base.getindex(pv::PValues, i::Integer) = pv.values[i]
35+
Base.setindex!(pv::PValues, x::AbstractFloat, i::Integer) =
36+
throw(ErrorException("Modification of values is not permitted"))
3537

3638
Base.values(pv::PValues) = pv.values
3739
Base.minimum(pv::PValues) = pv.min

test/test-types.jl

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using Base.Test
1414
pv = PValues(vals)
1515

1616
# basic vector functionality
17-
@test values(pv) vals
17+
@test values(pv) == vals
1818
@test sum(pv) == sum(vals)
1919
@test length(pv) == n
2020
@test ones(pv) == ones(eltype(vals), n)
@@ -27,10 +27,8 @@ using Base.Test
2727
# min/max are taken from the type fields,
2828
# not recomputed from the values
2929
pvt = PValues(vals)
30-
pvt.min = 0.0
31-
pvt.max = 1.0
32-
@test minimum(pvt) == 0.0
33-
@test maximum(pvt) == 1.0
30+
@test_throws ErrorException pvt.min = 0.0
31+
@test_throws ErrorException pvt.max = 1.0
3432

3533
# parametric type that keeps input float type
3634
for T in (Float16, Float32, Float64)
@@ -54,6 +52,29 @@ using Base.Test
5452

5553
end
5654

55+
56+
@testset "PValues immutability" begin
57+
58+
n = 10
59+
vals = rand(n)
60+
ref = deepcopy(vals)
61+
62+
pv = PValues(vals)
63+
64+
@test pv.values == ref
65+
@test extrema(pv) == extrema(pv.values)
66+
67+
vals[1] = 0.0
68+
vals[2] = 1.0
69+
70+
@test pv.values == ref
71+
@test pv.values != vals
72+
@test extrema(pv) == extrema(pv.values)
73+
74+
@test_throws ErrorException pv[1] = 0.0
75+
76+
end
77+
5778
end
5879

5980
end

0 commit comments

Comments
 (0)