Commit 9b4b00f5 authored by Alberto Ramos's avatar Alberto Ramos

Improved error messages

parent 9bee2807
......@@ -70,15 +70,22 @@ function add_DB(delta::Vector{Float64}, id::Int64, iv::Vector{Int64}, ws::wspace
end
else
if (sum(iv) != length(delta))
println(stderr, "ID: ", id)
ArgumentError("Sum of replica length does not match number of measurements")
end
ws.nob += 1
push!(ws.map_nob, id)
if (haskey(ws.map_ids, id))
if (length(delta) != ws.fluc[ws.map_ids[id]].nd)
println(stderr, "ID: ", id)
println(stderr, "DB length: ", ws.fluc[ws.map_ids[id]].nd)
println(stderr, "obs length: ", length(delta))
error("Mistmatch in data length for the same ensemble ID")
end
if (iv != ws.fluc[ws.map_ids[id]].ivrep)
println(stderr, "ID: ", id)
println(stderr, "DB replica: ", ws.fluc[ws.map_ids[id]].ivrep)
println(stderr, "obs replica: ", iv)
error("Mistmatch in replica vector for the same ensemble ID")
end
else
......
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