Three current functions are provided by the user as hooks in the calibration lifecycle: forward_model, observation_map, analyze_iteration.
The information passed into these functions is quite limited, and pipelines commonly end up loading the EKP struct and accessing global variables to compensate. We should provide a data structure containing these to each function to ensure that they have the needed variables by default.
Rough sketch of the data structure:
struct CalibrationContext
iteration::Int
member::Int
output_dir::String
ensemble_size::Int
prior::Union{ParameterDistribution, Nothing}
ekp::Union{EKP.EnsembleKalmanProcess, Nothing}
end
New function calls will be:
forward_model(ctx::CalibrationContext)
observation_map(ctx::CalibrationContext)
analyze_iteration(ctx::CalibrationContext, g_ensemble)
Three current functions are provided by the user as hooks in the calibration lifecycle:
forward_model,observation_map,analyze_iteration.The information passed into these functions is quite limited, and pipelines commonly end up loading the EKP struct and accessing global variables to compensate. We should provide a data structure containing these to each function to ensure that they have the needed variables by default.
Rough sketch of the data structure:
New function calls will be:
forward_model(ctx::CalibrationContext)observation_map(ctx::CalibrationContext)analyze_iteration(ctx::CalibrationContext, g_ensemble)