Skip to content

Commit

Permalink
key check added
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Sep 17, 2017
1 parent b0dfa0c commit d7d5ee1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/ReusableFunctions.jl
Expand Up @@ -181,7 +181,12 @@ function maker3function(f::Function, dirname::String, paramkeys::Vector, resultk
result = f(x)
vecresult = Array{Float64}(length(resultkeys))
for (i, k) in enumerate(resultkeys)
vecresult[i] = result[k]
if !haskey(result, k)
warn("ReusableFunctions error: Result does not have key $(k)!")
warn("ReusableFunctions result: $(result)")
else
vecresult[i] = result[k]
end
end
global computes += 1
saveresultfile(filename, vecresult, x; keyresult=resultkey, keyx=xkey)
Expand All @@ -206,7 +211,12 @@ function maker3function(f::Function, dirname::String, paramkeys::Vector, resultk
result = f(x)
vecresult = Array{Float64}(length(resultkeys))
for (i, k) in enumerate(resultkeys)
vecresult[i] = result[k]
if !haskey(result, k)
warn("ReusableFunctions error: Result does not have key $(k)!")
warn("ReusableFunctions result: $(result)")
else
vecresult[i] = result[k]
end
end
vecx = Array{Float64}(length(paramkeys))
for (i, k) in enumerate(paramkeys)
Expand Down

0 comments on commit d7d5ee1

Please sign in to comment.