Skip to content

Commit

Permalink
addobs
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Nov 24, 2023
1 parent d6b4748 commit fdf0cc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/MadsCalibrate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function calibrate(madsdata::AbstractDict; tolX::Number=1e-4, tolG::Number=1e-6,
rootname = Mads.getmadsrootname(madsdata)
madsdir = Mads.getmadsproblemdir(madsdata)
if !isdir(madsdir)
mkdir(madsdir)
Mads.recursivemkdir(madsdir)
end
f_lm, g_lm, o_lm = Mads.makelmfunctions(madsdata; parallel_gradients=parallel_optimization)
optparamkeys = Mads.getoptparamkeys(madsdata)
Expand Down
7 changes: 7 additions & 0 deletions src/MadsObservations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import OrderedCollections
import DocumentFunction
import JSON

function addobs!(madsdata::AbstractDict, obskey::AbstractString, obs::AbstractDict)
if !haskey(madsdata, "Observations")
madsdata["Observations"] = OrderedCollections.OrderedDict{String,OrderedCollections.OrderedDict}()
end
madsdata["Observations"][obskey] = obs
end

"""
Is a dictionary containing all the observations
Expand Down

0 comments on commit fdf0cc2

Please sign in to comment.