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
n = length(corr_diag) # matrix dimension
d = length(corr_upper) # upper elements
if d != (n*(n-1) / 2)
println("Error get_matrix")
return nothing
error("Error get_matrix")
end
res = Vector{Matrix}(undef, time) # array with all the matrices at each time step.
aux = Matrix{uwreal}(undef, n, n)
......@@ -388,8 +387,7 @@ function uwdot(a::Matrix{uwreal}, b::Matrix{uwreal})
k,p = size(b)
c = Matrix{uwreal}(undef, n, p)
if m != k
println("Error uwdot")
return nothing
error("Error uwdot")
end
for i = 1:n
for j = 1:p
......
......@@ -200,8 +200,7 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false
replica = length.(vtr)
if !all(id .== id[1])
println("IDs are not equal")
return nothing
error("IDs are not equal")
end
Ysl = isnothing(rw) ? Ysl : apply_rw(Ysl, rw)
......
......@@ -168,8 +168,7 @@ function read_rw(path::String; v::String="1.2")
nfct = ones(Int32, nrw)
nfct_inheader = 0
else
println("Error: Version not supported")
return nothing
error("Version not supported")
end
nsrc = Array{Int32}(undef, nrw)
read!(data, nsrc)
......
......@@ -79,8 +79,7 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array
replica = Int64.(maximum.(vcfg))
if !all(id .== id[1])
println("IDs are not equal")
return nothing
error("IDs are not equal")
end
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
p = findall(t-> t==1, a.prop)
if nid != 1
println("Error: neid > 1")
return nothing
error("neid > 1")
end
id = ws.map_nob[p]
if !all(id .== id[1])
println("ids do not match")
return nothing
error("ids do not match")
end
id = id[1]
ivrep = getfield.(ws.fluc[p], :ivrep)
ivrep1 = fill(ivrep[1], length(ivrep))
if !all(ivrep .== ivrep1)
println("ivreps do not match")
return nothing
error("ivreps do not match")
end
ivrep = ivrep[1]
if length(md) != length(ivrep)
println("Nr obs != Nr md")
return nothing
error("Nr obs != Nr md")
end
md_aux = md[1][:, 1:ivrep[1]]
......
......@@ -127,8 +127,7 @@ mutable struct Corr
h = getfield.(b, :header)
for s in sym
if !all(getfield.(h, s) .== getfield(h[1], s))
println("Corr: Parameter mismatch")
return nothing
error("Corr: Parameter mismatch")
end
end
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