From a40451c1a57523b236129268eb26c737f249b2bb Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 9 Sep 2024 17:08:18 -0600 Subject: [PATCH] Updated test_SS.py --- CHANGELOG.md | 3 ++- ogcore/default_parameters.json | 2 +- tests/test_SS.py | 11 +++++++---- .../inner_loop_outputs_baseline.pkl | Bin 18394 -> 18437 bytes ...r_loop_outputs_baseline_balance_budget.pkl | Bin 18394 -> 18437 bytes ...inner_loop_outputs_baseline_delta_tau0.pkl | Bin 18605 -> 18648 bytes ...inner_loop_outputs_baseline_small_open.pkl | Bin 18394 -> 18437 bytes .../inner_loop_outputs_reform.pkl | Bin 18380 -> 18423 bytes .../inner_loop_outputs_reform_M4.pkl | Bin 18644 -> 18687 bytes .../inner_loop_outputs_reform_MneI.pkl | Bin 18644 -> 18687 bytes ...r_loop_outputs_reform_baselinespending.pkl | Bin 18370 -> 18413 bytes 11 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6b5bdc17..3ed967d6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 diff --git a/ogcore/default_parameters.json b/ogcore/default_parameters.json index 84eccb9f8..a3b6aea4a 100644 --- a/ogcore/default_parameters.json +++ b/ogcore/default_parameters.json @@ -4309,7 +4309,7 @@ "type": "float", "value": [ { - "value": 1e-09 + "value": 1e-08 } ], "validators": { diff --git a/tests/test_SS.py b/tests/test_SS.py index 504d9d7ca..16602a1c2 100644 --- a/tests/test_SS.py +++ b/tests/test_SS.py @@ -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 @@ -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, @@ -557,6 +558,7 @@ def test_inner_loop(baseline, r_p, param_updates, filename, dask_client): _, _, _, + _, ) = test_tuple expected_tuple = ( euler_errors, @@ -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, @@ -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") diff --git a/tests/test_io_data/inner_loop_outputs_baseline.pkl b/tests/test_io_data/inner_loop_outputs_baseline.pkl index 59509fb9fabad18a205463cb92e429b5d998df60..5caa0e623a02914e7898879744aaecdedf9f0a9d 100644 GIT binary patch delta 199 zcmccB&)7PFk)?rU>aUF~FWl;RdYIBIrgV0+PYIf$;mw>O;OFP(^&bepgf~OUlq6>k zO}~liYL`#jPiX_H%23QuapsuSJ^SBD=aa}neal#;zI8l>EVNjuZWr@{=MW)x1}K1- skS-iLZB5> z#xnJ-<0)jJ#Y%O%m=`=p7D|_r_nrBCA+nI%!9I4GdpD4U`dLDj=aqkVn9??RntO~e T(83GRi$CeKJ%%VMnW6^(IG03T diff --git a/tests/test_io_data/inner_loop_outputs_baseline_balance_budget.pkl b/tests/test_io_data/inner_loop_outputs_baseline_balance_budget.pkl index 9063631c39fccf651c066fc9c0279f49e3d9d308..7b05a801ceb4dd58cac5a7cf7adcd1f1bcbd8366 100644 GIT binary patch delta 199 zcmccB&)7PFk)?rU>aUF~FWl;RdYIBIrgV0+PYIf$;mw>O;OFP(^&bepgf~OUlq6@4 zf(<4d0jJm4PiX_H%23Quapo{u7MpUvcM-A>7FC-)OJv(CKSNZxGe7~vghw}KEmcDgV_kMnpbA2u+T6&kzP$ClJ(hiLZ5DlkcF_Q z+U!{(+g|w@S=FN(vzDypT8At&<-hvHh{z|%LQz{oB3`%sc9_yOd768SFwjDQpr#{F Mmpp(dDw(1O05ttYnE(I) diff --git a/tests/test_io_data/inner_loop_outputs_baseline_delta_tau0.pkl b/tests/test_io_data/inner_loop_outputs_baseline_delta_tau0.pkl index eea841455848d14943e83304c5e30fa58726c4d0..40e2a2c033cd5e6720fe91f4d9815049c9feedab 100644 GIT binary patch delta 117 zcmZ2Gk@3bvMwSMasb@E`uzUErGeAKGLl0YVa$-(m(Ui$kGI)BJ(k!NQcC=3knxf&& zoFU-n=jZhw2*89lL&=mRXO7yaxQ?99=A<+a-O-QOS* HB~$bO^%yVR delta 74 zcmcaHk#X%rMwSMasf#wUuzM(FF!Zn$Cnx447EPHvC4=9YqxZdFj@8-8_EXxX1Wm~Z a$l#wG;gKs0lxV;5T5bF8ZxD%+DS7}Ql^y#4 diff --git a/tests/test_io_data/inner_loop_outputs_baseline_small_open.pkl b/tests/test_io_data/inner_loop_outputs_baseline_small_open.pkl index a10175a203840883c31fe9109f93a936e9affce9..f239f6da7a339b9cd643d47d89483cf4669a21f6 100644 GIT binary patch delta 199 zcmccB&)7PFk)?rU>aUF~FWl;RdYIBIrgV0+PYIf$;mw>O;OFP(^&bepgf~OUlq6@4 z29b5{5382gPiX_H%23Quapq_R3r#^55=}OEQu%QKvd}HB&|SI#Um-&73{U_u;m}K| p?{no#Hz2E*NnHBb?#?rW(Bydc3}K*kFJ3QnH@W-(B2h9$4*>NuQz`%e delta 167 zcmZpjz<8^lk)?rU>iLZYI%$FWl;RdYIBIrgV0+PYIf$;mw>O;OFP(^&bepgf~OUlq6>k zO}~liYL`#jPiX_H%23QuapsuSJ^SBD=aa}neal#;zI8l>EVNjuZWr@{=MW)x1}K1- jkS-Svk)?rU>cNdHFWeINojEl9CaSAlK5ajxZA#FT48;tf(5&v+|4ureL>B5> z#xnJ-<0)jJ#Y%O%m=`=p7D|_r_nrBCAwpOwj`X@VGb= diff --git a/tests/test_io_data/inner_loop_outputs_reform_M4.pkl b/tests/test_io_data/inner_loop_outputs_reform_M4.pkl index 846bbdcba662bd6736d5c05c7b32368ed423e409..e347361f976142760159951d858eb69f5cf18500 100644 GIT binary patch delta 137 zcmcaIk@5dTMwSMasb4m-yl^w)>0wH3<^T0wHnTBdh=b diff --git a/tests/test_io_data/inner_loop_outputs_reform_baselinespending.pkl b/tests/test_io_data/inner_loop_outputs_reform_baselinespending.pkl index 4136d84dbd85ef55b454bbbb226cd2ca6a00cb79..f24c73db7a1616037260118a86af587b44cf268b 100644 GIT binary patch delta 170 zcmX@q&-k{Vk)?rU>Z6S;FWl;RdYIBIrgV0+PYIf$;mw>O;OFP(^&bepgf~OUlq6>k zO}~liYL`#jPiX_H%23QuapsuSJ^SBD=aa}neal#;zI8l>EVNjuZWr@{=MW)x1}Jd1 l-?t<1b*tQt3`M34mB~)-xxzpbFGMf?q|^2oqPAp;9srfUM+*P| delta 126 zcmaFc&v>Yxk)?rU>h_H+FWkcTojEl9CaSAlK5ajxZA#FT48;tf(5&v+|4ureL>B5> z#xnJ-<0)jJ#Y%O%m=`>U2)Wzu+Y$J>Rc;5!gvq(?xxzqmE<`W>q|^2oqM~Gq9sv0M BHAnye