Skip to content

Commit dce2d57

Browse files
authored
drop < 1.0 support, switch to Project.toml (#20)
* drop < 1.0 support, switch to Project.toml * update travis
1 parent 9e8d36c commit dce2d57

File tree

5 files changed

+22
-25
lines changed

5 files changed

+22
-25
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ os:
44
- linux
55
- osx
66
julia:
7-
- 0.6
8-
- 0.7
97
- 1.0
8+
- 1.1
109
- nightly
1110
notifications:
1211
email: false

Project.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name = "Sobol"
2+
uuid = "ed01d8cd-4d21-5b2a-85b4-cc3bdc58bad4"
3+
version = "1.2.0"
4+
5+
[deps]
6+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
7+
8+
[compat]
9+
julia = "1"
10+
11+
[extras]
12+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
13+
14+
[targets]
15+
test = ["Test"]

REQUIRE

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/Sobol.jl

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
VERSION < v"0.7.0-beta2.199" && __precompile__()
2-
31
module Sobol
4-
using Compat, Compat.Random
5-
export SobolSeq, ScaledSobolSeq, next!, next
6-
@static if isdefined(Base, :next)
7-
import Base: next
8-
end
2+
using Random
3+
export SobolSeq, ScaledSobolSeq, next!
94

105
include("soboldata.jl") #loads `sobol_a` and `sobol_minit`
116

@@ -81,8 +76,6 @@ function next!(s::SobolSeq, x::AbstractVector{<:AbstractFloat})
8176
end
8277
next!(s::SobolSeq) = next!(s, Array{Float64,1}(undef, ndims(s)))
8378

84-
@deprecate next(s::AbstractSobolSeq) next!(s)
85-
8679
# if we know in advance how many points (n) we want to compute, then
8780
# adopt the suggestion of the Joe and Kuo paper, which in turn
8881
# is taken from Acworth et al (1998), of skipping a number of
@@ -105,16 +98,10 @@ end
10598
# Technically, the Sobol sequence ends after 2^32-1 points, but it
10699
# falls back on pseudorandom numbers after this. In practice, one is
107100
# unlikely to reach that point.
108-
@static if isdefined(Base, :iterate)
109-
Base.iterate(s::AbstractSobolSeq, state=nothing) = (next!(s), state)
110-
else
111-
Base.start(s::AbstractSobolSeq) = nothing
112-
Base.next(s::AbstractSobolSeq, state) = (next!(s), state)
113-
Base.done(s::AbstractSobolSeq, state) = false
114-
end
101+
Base.iterate(s::AbstractSobolSeq, state=nothing) = (next!(s), state)
115102
Base.eltype(::Type{<:AbstractSobolSeq}) = Vector{Float64}
116-
Compat.IteratorSize(::Type{<:AbstractSobolSeq}) = Base.IsInfinite()
117-
Compat.IteratorEltype(::Type{<:AbstractSobolSeq}) = Base.HasEltype()
103+
Base.IteratorSize(::Type{<:AbstractSobolSeq}) = Base.IsInfinite()
104+
Base.IteratorEltype(::Type{<:AbstractSobolSeq}) = Base.HasEltype()
118105

119106
# Convenience wrapper for scaled Sobol sequences
120107

@@ -144,7 +131,6 @@ next!(s::SobolSeq{N}, lb::AbstractVector, ub::AbstractVector) where {N} = next!(
144131

145132
next!(s::ScaledSobolSeq, x::AbstractVector{<:AbstractFloat}) = next!(s.s, x, s.lb, s.ub)
146133
next!(s::ScaledSobolSeq) = next!(s.s, Array{Float64,1}(undef, ndims(s)), s.lb, s.ub)
147-
next(s::ScaledSobolSeq) = next!(s, Vector{Float64}(undef, ndims(s)))
148134

149135
Base.skip(s::ScaledSobolSeq, n) = skip(s.s, n)
150136

test/runtests.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Sobol, Compat
2-
using Compat.Test
1+
using Sobol, Test
32

43
# compare results with results from C++ code sobol.cc published on
54
# http://web.maths.unsw.edu.au/~fkuo/sobol/

0 commit comments

Comments
 (0)