Skip to content

Commit fd0d626

Browse files
committed
fix for Julia 1.x
1 parent 4c18a69 commit fd0d626

8 files changed

+63
-42
lines changed

.travis.yml

+17-18
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,24 @@
22
language: julia
33
os:
44
- linux
5-
sudo: required
65
julia:
7-
- release
8-
# - nightly
9-
6+
- 1.1
107
notifications:
118
email: false
12-
# uncomment the following lines to override the default test script
13-
script:
14-
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
15-
- LD_PRELOAD=${HOME}/.julia/v0.6/Conda/deps/usr/lib/libz.so julia -e 'Pkg.clone(pwd()); Pkg.build("OpenMPIData"); Pkg.test("OpenMPIData"; coverage=true)'
16-
before_install:
17-
- julia -e 'Pkg.update()'
18-
#- test "x$TRAVIS_OS_NAME" = xosx -o "x$PYTHON" = xConda-python || (sudo apt-get -qq update && sudo apt-get install -y $PYTHON)
19-
# Work around (part 1/2) matplotlib backend error leading to "matplotlib.pyplot could not be found by pyimport": can't just set env PYTHON="".
20-
- julia -e 'ENV["PYTHON"]=""; Pkg.add("Conda"); using Conda; Conda.update(); Conda.add("matplotlib"); Pkg.add("PyCall"); Pkg.build("PyCall"); Pkg.add("PyPlot");'
9+
branches:
10+
only: master
11+
12+
## uncomment following lines to deploy documentation
13+
jobs:
14+
include:
15+
- stage: Documentation
16+
julia: 1.1
17+
os: linux
18+
script:
19+
- julia --project=docs -e 'using Pkg; Pkg.instantiate(); Pkg.add(PackageSpec(path=pwd()))'
20+
- julia --project=docs docs/make.jl
21+
after_success: skip
22+
2123
after_success:
22-
# push coverage results to Coveralls
23-
#- export LD_LIBRARY_PATH=$HOME/.julia/v0.6/Conda/deps/usr/lib julia -e 'cd(Pkg.dir("OpenMPIData")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
24-
# push coverage results to Codecov
25-
#- export LD_LIBRARY_PATH=$HOME/.julia/v0.6/Conda/deps/usr/lib julia -e 'cd(Pkg.dir("OpenMPIData")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
26-
- LD_PRELOAD=${HOME}/.julia/v0.6/Conda/deps/usr/lib/libz.so julia -e 'cd(Pkg.dir("OpenMPIData")); ENV["DOCUMENTER_DEBUG"] = "true"; include(joinpath("docs", "make.jl"))'
24+
- julia --project=test/coverage -e 'using Pkg; Pkg.instantiate()'
25+
- julia --project=test/coverage test/coverage/coverage.jl

REQUIRE

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
julia 1.0
22
Documenter
3-
#Requests
3+
Reexport
44
PyPlot
55
HDF5
6+
MPIFiles
7+
RegularizedLeastSquares
8+
HTTP

docs/Project.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[deps]
2+
MPIFiles = "371237a9-e6c1-5201-9adb-3d8cfa78fa9f"
3+
RegularizedLeastSquares = "1e9c538a-f78c-5de5-8ffb-0b6dbe892d23"
4+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
5+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
6+
LinearOperators = "5c8ed15e-5a4c-59e4-a42b-c7e8811fb125"
7+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
8+
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
9+
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
10+
OpenMPIData = "46e8875b-c064-59da-a3bf-c1683cc8c07a"

docs/make.jl

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ makedocs(
1616
"Datasets" => "datasets.md",
1717
"Reconstruction"=> "reconstructions.md"
1818
],
19+
html_prettyurls = false, #!("local" in ARGS)
1920
)
2021

2122
deploydocs(repo = "github.com/MagneticParticleImaging/OpenMPIData.jl.git",
22-
julia = "release",
23-
target = "build",
24-
deps = nothing,
25-
make = nothing)
23+
target = "build")

src/OpenMPIData.jl

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
module OpenMPIData
22

33
using Reexport
4-
if !isdir(Pkg.dir("MPIFiles"))
5-
println("Installing MPIFiles...")
6-
Pkg.clone("https://github.com/MagneticParticleImaging/MPIFiles.jl.git")
7-
end
84
@reexport using MPIFiles
9-
@reexport using PyPlot
5+
#@reexport using PyPlot
106

117
include("download.jl")
128
include("reconstruction.jl")
13-
include("visualization.jl")
9+
#include("visualization.jl")
1410

1511
end # module

src/download.jl

+26-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Requests
1+
using Pkg, HTTP
22

33
export downloadOpenMPIData, downloadCalibrationDataHighRes, downloadCalibrationDataLowRes,
44
download2DData, download3DData
@@ -27,8 +27,11 @@ function download1DData()
2727
"data/measurements/concentrationPhantom/1.mdf"]
2828

2929
for file in files
30-
stream = get("http://media.tuhh.de/ibi/openMPIData/"*file)
31-
save(stream, Pkg.dir("OpenMPIData",file))
30+
HTTP.open("GET", "http://media.tuhh.de/ibi/openMPIData/"*file) do http
31+
open(Pkg.dir("OpenMPIData",file), "w") do file
32+
write(file, http)
33+
end
34+
end
3235
end
3336
end
3437
function download2DData()
@@ -39,8 +42,11 @@ function download2DData()
3942
"data/measurements/concentrationPhantom/2.mdf"]
4043

4144
for file in files
42-
stream = get("http://media.tuhh.de/ibi/openMPIData/"*file)
43-
save(stream, Pkg.dir("OpenMPIData",file))
45+
HTTP.open("GET", "http://media.tuhh.de/ibi/openMPIData/"*file) do http
46+
open(Pkg.dir("OpenMPIData",file), "w") do file
47+
write(file, http)
48+
end
49+
end
4450
end
4551
end
4652

@@ -51,8 +57,11 @@ function download3DData()
5157
"data/measurements/concentrationPhantom/3.mdf"]
5258

5359
for file in files
54-
stream = get("http://media.tuhh.de/ibi/openMPIData/"*file)
55-
save(stream, Pkg.dir("OpenMPIData",file))
60+
HTTP.open("GET", "http://media.tuhh.de/ibi/openMPIData/"*file) do http
61+
open(Pkg.dir("OpenMPIData",file), "w") do file
62+
write(file, http)
63+
end
64+
end
5665
end
5766
end
5867

@@ -64,8 +73,11 @@ function downloadCalibrationDataLowRes()
6473
"data/calibrations/3.mdf",]
6574

6675
for file in files
67-
stream = get("http://media.tuhh.de/ibi/openMPIData/"*file)
68-
save(stream, Pkg.dir("OpenMPIData",file))
76+
HTTP.open("GET", "http://media.tuhh.de/ibi/openMPIData/"*file) do http
77+
open(Pkg.dir("OpenMPIData",file), "w") do file
78+
write(file, http)
79+
end
80+
end
6981
end
7082
end
7183

@@ -77,7 +89,10 @@ function downloadCalibrationDataHighRes()
7789
"data/calibrations/6.mdf",]
7890

7991
for file in files
80-
stream = get("http://media.tuhh.de/ibi/openMPIData/"*file)
81-
save(stream, Pkg.dir("OpenMPIData",file))
92+
HTTP.open("GET", "http://media.tuhh.de/ibi/openMPIData/"*file) do http
93+
open(Pkg.dir("OpenMPIData",file), "w") do file
94+
write(file, http)
95+
end
96+
end
8297
end
8398
end

src/reconstruction.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ argminₓ(‖Ax-b‖² + λ‖b‖²).
5454
* `enforceReal::Bool`: Enable projection of solution on real plane during iteration
5555
* `enforcePositive::Bool`: Enable projection of solution onto positive halfplane during iteration
5656
""" ->
57-
function kaczmarzReg{T}(A::AbstractMatrix{T}, b::Vector{T}, iterations, lambd, shuff, enforceReal, enforcePositive )
57+
function kaczmarzReg(A::AbstractMatrix{T}, b::Vector{T}, iterations, lambd, shuff, enforceReal, enforcePositive ) where T
5858
M = size(A,2)
5959
N = size(A,1)
6060

test/runtests.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using OpenMPIData
2-
using Base.Test
2+
using Test
33

44
# write your own tests here
55
@test 1 == 1

0 commit comments

Comments
 (0)