diff --git a/pyciemss/integration_utils/intervention_builder.py b/pyciemss/integration_utils/intervention_builder.py index 30345d16..e6049150 100644 --- a/pyciemss/integration_utils/intervention_builder.py +++ b/pyciemss/integration_utils/intervention_builder.py @@ -78,7 +78,7 @@ def start_time_param_value_objective( def intervention_generator( x: torch.Tensor, ) -> Dict[float, Dict[str, Intervention]]: - assert x.size()[0] == param_size * 2 + assert x.size()[0] == param_size * 2, "Size mismatch: check size for initial_guess_interventions and/or bounds_interventions" static_parameter_interventions: Dict[float, Dict[str, Intervention]] = {} for count in range(param_size): if x[count * 2].item() in static_parameter_interventions: diff --git a/tests/fixtures.py b/tests/fixtures.py index 55daf4d4..9d2d7580 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -124,9 +124,9 @@ def __init__( "static_parameter_interventions": start_time_param_value_objective( param_name=["p_cbeta"], ), - "objfun": lambda x: -x, - "initial_guess_interventions": 1.0, - "bounds_interventions": [[0.0], [40.0]], + "objfun": lambda x: -x[0] * 0.25 / (0.0 - 40.0) + np.abs(0.35 - x[1]) * 1.0, + "initial_guess_interventions": [1.0, 0.15], + "bounds_interventions": [[0.0, 0.1], [40.0, 0.5]], } optimize_kwargs_SEIRHD_param_maxQoI = {