Commit 15e017ec authored by Javier's avatar Javier

println + return nothing -> error

parent d1718d1d
...@@ -56,8 +56,7 @@ function get_matrix(corr_diag::Vector{Vector{uwreal}}, corr_upper::Vector{Vector ...@@ -56,8 +56,7 @@ function get_matrix(corr_diag::Vector{Vector{uwreal}}, corr_upper::Vector{Vector
n = length(corr_diag) # matrix dimension n = length(corr_diag) # matrix dimension
d = length(corr_upper) # upper elements d = length(corr_upper) # upper elements
if d != (n*(n-1) / 2) if d != (n*(n-1) / 2)
println("Error get_matrix") error("Error get_matrix")
return nothing
end end
res = Vector{Matrix}(undef, time) # array with all the matrices at each time step. res = Vector{Matrix}(undef, time) # array with all the matrices at each time step.
aux = Matrix{uwreal}(undef, n, n) aux = Matrix{uwreal}(undef, n, n)
...@@ -388,8 +387,7 @@ function uwdot(a::Matrix{uwreal}, b::Matrix{uwreal}) ...@@ -388,8 +387,7 @@ function uwdot(a::Matrix{uwreal}, b::Matrix{uwreal})
k,p = size(b) k,p = size(b)
c = Matrix{uwreal}(undef, n, p) c = Matrix{uwreal}(undef, n, p)
if m != k if m != k
println("Error uwdot") error("Error uwdot")
return nothing
end end
for i = 1:n for i = 1:n
for j = 1:p for j = 1:p
......
...@@ -200,8 +200,7 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false ...@@ -200,8 +200,7 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false
replica = length.(vtr) replica = length.(vtr)
if !all(id .== id[1]) if !all(id .== id[1])
println("IDs are not equal") error("IDs are not equal")
return nothing
end end
Ysl = isnothing(rw) ? Ysl : apply_rw(Ysl, rw) Ysl = isnothing(rw) ? Ysl : apply_rw(Ysl, rw)
......
...@@ -168,8 +168,7 @@ function read_rw(path::String; v::String="1.2") ...@@ -168,8 +168,7 @@ function read_rw(path::String; v::String="1.2")
nfct = ones(Int32, nrw) nfct = ones(Int32, nrw)
nfct_inheader = 0 nfct_inheader = 0
else else
println("Error: Version not supported") error("Version not supported")
return nothing
end end
nsrc = Array{Int32}(undef, nrw) nsrc = Array{Int32}(undef, nrw)
read!(data, nsrc) read!(data, nsrc)
......
...@@ -79,8 +79,7 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array ...@@ -79,8 +79,7 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array
replica = Int64.(maximum.(vcfg)) replica = Int64.(maximum.(vcfg))
if !all(id .== id[1]) if !all(id .== id[1])
println("IDs are not equal") error("IDs are not equal")
return nothing
end end
real ? data = getfield.(cdata, :re_data) ./ L^3 : data = getfield.(cdata, :im_data) ./ L^3 real ? data = getfield.(cdata, :re_data) ./ L^3 : data = getfield.(cdata, :im_data) ./ L^3
...@@ -141,28 +140,24 @@ function md_sea(a::uwreal, md::Vector{Matrix{Float64}}, ws::ADerrors.wspace=ADer ...@@ -141,28 +140,24 @@ function md_sea(a::uwreal, md::Vector{Matrix{Float64}}, ws::ADerrors.wspace=ADer
p = findall(t-> t==1, a.prop) p = findall(t-> t==1, a.prop)
if nid != 1 if nid != 1
println("Error: neid > 1") error("neid > 1")
return nothing
end end
id = ws.map_nob[p] id = ws.map_nob[p]
if !all(id .== id[1]) if !all(id .== id[1])
println("ids do not match") error("ids do not match")
return nothing
end end
id = id[1] id = id[1]
ivrep = getfield.(ws.fluc[p], :ivrep) ivrep = getfield.(ws.fluc[p], :ivrep)
ivrep1 = fill(ivrep[1], length(ivrep)) ivrep1 = fill(ivrep[1], length(ivrep))
if !all(ivrep .== ivrep1) if !all(ivrep .== ivrep1)
println("ivreps do not match") error("ivreps do not match")
return nothing
end end
ivrep = ivrep[1] ivrep = ivrep[1]
if length(md) != length(ivrep) if length(md) != length(ivrep)
println("Nr obs != Nr md") error("Nr obs != Nr md")
return nothing
end end
md_aux = md[1][:, 1:ivrep[1]] md_aux = md[1][:, 1:ivrep[1]]
......
...@@ -127,8 +127,7 @@ mutable struct Corr ...@@ -127,8 +127,7 @@ mutable struct Corr
h = getfield.(b, :header) h = getfield.(b, :header)
for s in sym for s in sym
if !all(getfield.(h, s) .== getfield(h[1], s)) if !all(getfield.(h, s) .== getfield(h[1], s))
println("Corr: Parameter mismatch") error("Corr: Parameter mismatch")
return nothing
end end
end end
mu = [h[1].mu1, h[1].mu2] mu = [h[1].mu1, h[1].mu2]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment