diff --git a/ogcore/default_parameters.json b/ogcore/default_parameters.json index 8180be0ba..35f336f9c 100644 --- a/ogcore/default_parameters.json +++ b/ogcore/default_parameters.json @@ -2985,8 +2985,8 @@ } }, "baseline_spending": { - "title": "Flag to keep level of government spending and transfers constant between baseline and reform runs", - "description": "Flag to keep level of government spending and transfers constant between baseline and reform runs.", + "title": "Flag for use in reform simulations to keep level of government spending and transfers constant between baseline and reform runs", + "description": "Flag for use in reform simulations to keep level of government spending and transfers constant between baseline and reform runs.", "section_1": "Fiscal Policy Parameters", "section_2": "Spending", "notes": "", diff --git a/ogcore/parameters.py b/ogcore/parameters.py index 63245c48c..7e8166152 100644 --- a/ogcore/parameters.py +++ b/ogcore/parameters.py @@ -64,6 +64,13 @@ def compute_default_params(self): None ''' + # Catch error if baseline_spending=True and baseline=True + if self.baseline_spending and self.baseline: + err_msg = ( + 'Parameter baseline_spending=True cannot coincide with ' + + 'baseline=True.') + raise ValueError(err_msg) + # reshape lambdas self.lambdas = self.lambdas.reshape(self.lambdas.shape[0], 1) # cast integers as integers diff --git a/tests/test_SS.py b/tests/test_SS.py index 2728d66ff..18c7abbc9 100644 --- a/tests/test_SS.py +++ b/tests/test_SS.py @@ -513,8 +513,9 @@ def test_run_SS(tmpdir, baseline, param_updates, filename, dask_client): baseline_dir=baseline_dir, baseline=True, num_workers=NUM_WORKERS) - p_base.update_specifications(param_updates) - p_base.baseline_spending = False + param_updates_base = param_updates.copy() + param_updates_base['baseline_spending'] = False + p_base.update_specifications(param_updates_base) base_ss_outputs = SS.run_SS(p_base, client=dask_client) utils.mkdirs(os.path.join(baseline_dir, "SS")) ss_dir = os.path.join(baseline_dir, "SS", "SS_vars.pkl")