This function perform some tests of CroptimizR model wrappers. See @details for more information.
test_wrapper(
model_function,
model_options,
param_values,
situation,
var = NULL,
sit_names = lifecycle::deprecated(),
var_names = lifecycle::deprecated()
)
Crop Model wrapper function to use.
List of options for the Crop Model wrapper (see help of the Crop Model wrapper function used).
a named vector that contains values and names for AT LEAST TWO model parameters THAT ARE EXPECTED TO PLAY ON ITS RESULTS.
Vector of situations names for which results must be tested.
(optional) Vector of variables names for which results must be tested.
A list containing:
test_results: a vector of boolean indicating which test succeeded (TRUE) or failed (FALSE)
param_values_1: first subset of param_values
param_values_2: second subset of param_values
sim_1: results obtained with param_values_1
sim_2: results obtained with param_values_2
sim_3: results obtained for second run with param_values_1
This function runs the wrapper consecutively with different subsets of param_values. It then checks:
the format of the returned results
the results are different when different subsets of param_values are used,
the results are identical when same subsets of param_values are used.