Skip to content

Commit c955ca7

Browse files
committed
Use dirname(@__FILE__) instead of Pkg.dir
This allows installing the package elsewhere. Add testing against 0.5 to Travis - this runs the most recent RC now, release once final tags are done Add Compat explicitly to REQUIRE instead of assuming it will be present as a transitive dependency
1 parent bf3bbb1 commit c955ca7

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ os:
77
- linux
88
julia:
99
- 0.4
10+
- 0.5
1011
- nightly
1112
sudo: false
1213
notifications:
1314
email: false
14-
script:
15-
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
16-
- julia -e 'Pkg.clone(pwd()); Pkg.build("RandomMatrices"); Pkg.test("RandomMatrices"; coverage=true)'
15+
#script: # use the default script setting which is equivalent to the following
16+
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
17+
# - julia -e 'Pkg.clone(pwd()); Pkg.build("RandomMatrices"); Pkg.test("RandomMatrices"; coverage=true)'
1718
after_success:
1819
- julia -e 'Pkg.add("Coverage"); cd(Pkg.dir("RandomMatrices")); using Coverage; Coveralls.submit(process_folder()); Codecov.submit(process_folder())'
1920

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Combinatorics 0.2
33
Distributions 0.8.10
44
ODE 0.2.1
55
GSL 0.3.1
6+
Compat

src/InvariantEnsembles.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ end
140140

141141
#Reads in recurrence relationship and constructs OPs
142142
function InvariantEnsemble(str::AbstractString,V::Function,d,n::Integer)
143-
file = Pkg.dir("RandomMatrices/data/CoefficientDatabase/" * str * "/" * string(n))
143+
file = joinpath(dirname(@__FILE__), "../data/CoefficientDatabase/" * str * "/" * string(n))
144144
μ0=readdlm(file * "norm.csv")[1]
145145
A=readdlm(file * "rc.csv",',')
146146
a=reshape((A[1,1:end-1]),size(A)[2]-1)
@@ -152,7 +152,7 @@ end
152152

153153
# For constructing InvariantEnsembles that do not scale with n
154154
function InvariantEnsembleUnscaled(str::AbstractString,V::Function,d,n::Integer)
155-
file = Pkg.dir("RandomMatrices/data/CoefficientDatabaseUnscaled/" * str * "/")
155+
file = joinpath(dirname(@__FILE__), "../data/CoefficientDatabaseUnscaled/" * str * "/")
156156
μ0=readdlm(file * "norm.csv")[1]
157157
A=readdlm(file * "rc.csv",',')
158158
a=reshape((A[1,1:end-1]),size(A)[2]-1)
@@ -289,7 +289,7 @@ samplespectra(p::InvariantEnsemble)=samplespectra(p.basis,p.domain)
289289

290290

291291
function spectradatabase(str,n::Integer,m::Colon)
292-
file = Pkg.dir("RandomMatrices/data/SpectraDatabase/" * str * "/" * string(n) * ".csv");
292+
file = joinpath(dirname(@__FILE__), "../data/SpectraDatabase/" * str * "/" * string(n) * ".csv");
293293

294294
if(filesize(file) == 0)
295295
[]
@@ -299,21 +299,21 @@ function spectradatabase(str,n::Integer,m::Colon)
299299
end
300300

301301
function spectradatabase(str,n::Integer,m::Integer)
302-
if filesize(Pkg.dir("RandomMatrices/data/CoefficientDatabase")) == 0 ||
303-
filesize(Pkg.dir("RandomMatrices/data/CoefficientDatabaseUnscaled")) == 0
302+
if filesize(joinpath(dirname(@__FILE__), "../data/CoefficientDatabase")) == 0 ||
303+
filesize(joinpath(dirname(@__FILE__), "../data/CoefficientDatabaseUnscaled")) == 0
304304
error("No coefficient database found. InvariantEnsembles package corrupted.")
305305
end
306306

307307

308-
dir = Pkg.dir("RandomMatrices/data/SpectraDatabase")
308+
dir = joinpath(dirname(@__FILE__), "../data/SpectraDatabase")
309309
if filesize(dir) == 0
310310
warn("Creating SpectraDatabase folder " * dir)
311311

312312
mkdir(dir)
313313
end
314314

315315

316-
dir = Pkg.dir("RandomMatrices/data/SpectraDatabase/" * str)
316+
dir = joinpath(dirname(@__FILE__), "../data/SpectraDatabase/" * str)
317317

318318
if filesize(dir) == 0
319319
warn("Creating folder " * dir)

0 commit comments

Comments
 (0)