Skip to content

Commit

Permalink
Updated test_SS.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rickecon committed Sep 9, 2024
1 parent eb14ed1 commit a40451c
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.13.0] - 2024-09-05 12:00:00
## [0.13.0] - 2024-09-10 12:00:00

### Added

Expand All @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added "Transfers to households" section in `households.md`
- Added pensions to household budget constraint
- Rewrote household budget constraint in terms of individual variables
- Increased `RC_SS` steady-state resource constraint tolerance from 1e-9 to 1e-8 because two `test_run_SS()` tests were failing in `test_SS.py` with resource constraints errors just bigger than 1e-9 (-2.29575914e-09 for [Baseline, small open] and -2.29575914e-09 for [Reform, small open]).

## [0.12.0] - 2024-08-20 12:00:00

Expand Down
2 changes: 1 addition & 1 deletion ogcore/default_parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -4309,7 +4309,7 @@
"type": "float",
"value": [
{
"value": 1e-09
"value": 1e-08
}
],
"validators": {
Expand Down
11 changes: 7 additions & 4 deletions tests/test_SS.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@ def test_SS_solver_extra(baseline, param_updates, filename, dask_client):
],
)
def test_inner_loop(baseline, r_p, param_updates, filename, dask_client):
# Test SS.inner_loop function. Provide inputs to function and
# ensure that output returned matches what it has been before.
# Test SS.inner_loop function. Provide inputs to function and ensure that
# output returned matches what it has been before.
p = Specifications(baseline=baseline, num_workers=NUM_WORKERS)
p.update_specifications(param_updates)
p.output_base = CUR_PATH
Expand Down Expand Up @@ -532,6 +532,7 @@ def test_inner_loop(baseline, r_p, param_updates, filename, dask_client):
new_r_gov,
new_r_p,
new_w,
new_RM,
new_TR,
Y,
new_factor,
Expand All @@ -557,6 +558,7 @@ def test_inner_loop(baseline, r_p, param_updates, filename, dask_client):
_,
_,
_,
_,
) = test_tuple
expected_tuple = (
euler_errors,
Expand All @@ -570,6 +572,7 @@ def test_inner_loop(baseline, r_p, param_updates, filename, dask_client):
K_vec,
L_vec,
Y_vec,
new_RM,
new_TR,
Y,
new_factor,
Expand Down Expand Up @@ -1131,8 +1134,8 @@ def test_euler_equation_solver(input_tuple, ubi_j, p, expected):
)
@pytest.mark.local
def test_run_SS(tmpdir, baseline, param_updates, filename, dask_client):
# Test SS.run_SS function. Provide inputs to function and
# ensure that output returned matches what it has been before.
# Test SS.run_SS function. Provide inputs to function and ensure that
# output returned matches what it has been before.
SS.ENFORCE_SOLUTION_CHECKS = True
# if running reform, then need to solve baseline first to get values
baseline_dir = os.path.join(tmpdir, "OUTPUT_BASELINE")
Expand Down
Binary file modified tests/test_io_data/inner_loop_outputs_baseline.pkl
Binary file not shown.
Binary file modified tests/test_io_data/inner_loop_outputs_baseline_balance_budget.pkl
Binary file not shown.
Binary file modified tests/test_io_data/inner_loop_outputs_baseline_delta_tau0.pkl
Binary file not shown.
Binary file modified tests/test_io_data/inner_loop_outputs_baseline_small_open.pkl
Binary file not shown.
Binary file modified tests/test_io_data/inner_loop_outputs_reform.pkl
Binary file not shown.
Binary file modified tests/test_io_data/inner_loop_outputs_reform_M4.pkl
Binary file not shown.
Binary file modified tests/test_io_data/inner_loop_outputs_reform_MneI.pkl
Binary file not shown.
Binary file modified tests/test_io_data/inner_loop_outputs_reform_baselinespending.pkl
Binary file not shown.

0 comments on commit a40451c

Please sign in to comment.