Skip to content

Commit

Permalink
ensemble-calibrate saveat timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
jClugstor committed Dec 19, 2023
1 parent c292e1e commit 2b85e51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,13 @@ function solve(o::EnsembleCalibrate; callback)

enprob = EasyModelAnalysis.EnsembleProblem([probs[id] for id in model_ids])

sol = solve(enprob; saveat = 1, callback);

data = o.df

data_pairs = [Symbol(name) => data[:,name] for name in names(data)]
data_pairs = filter(x -> x[1] != :timestamp ,data_pairs)
t_stamps = filter(x -> x[1] == :timestamp, data_pairs)
data_pairs = filter(x -> x[1] != :timestamp, data_pairs)
sol_mappings_list = [o.sol_mappings[id] for id in model_ids]
sol = solve(enprob; saveat = t_stamps[1][2], callback);
weights = SimulationService.ensemble_weights(sol,data_pairs,sol_mappings_list)
DataFrame(model_ids .=> weights)
end
Expand Down

0 comments on commit 2b85e51

Please sign in to comment.