@@ -507,30 +507,30 @@ def test_inner_loop():
507507@pytest .mark .parametrize (
508508 "baseline,param_updates,filename" ,
509509 [
510- (True , param_updates2 , filename2 ),
510+ # (True, param_updates2, filename2),
511511 (True , {"initial_guess_r_SS" : 0.035 }, filename1 ),
512- (False , {}, filename3 ),
513- (False , param_updates4 , filename4 ),
514- (True , param_updates5 , filename5 ),
515- (True , param_updates6 , filename6 ),
516- (True , param_updates7 , filename7 ),
517- (True , param_updates8 , filename8 ),
518- (True , param_updates9 , filename9 ),
519- (True , param_updates10 , filename10 ),
520- (True , param_updates11 , filename11 ),
512+ # (False, {}, filename3),
513+ # (False, param_updates4, filename4),
514+ # (True, param_updates5, filename5),
515+ # (True, param_updates6, filename6),
516+ # (True, param_updates7, filename7),
517+ # (True, param_updates8, filename8),
518+ # (True, param_updates9, filename9),
519+ # (True, param_updates10, filename10),
520+ # (True, param_updates11, filename11),
521521 ],
522522 ids = [
523- "Baseline, balanced budget" ,
523+ # "Baseline, balanced budget",
524524 "Baseline" ,
525- "Reform" ,
526- "Reform, baseline spending" ,
527- "Baseline, small open" ,
528- "Baseline, small open some periods" ,
529- "Baseline, delta_tau = 0" ,
530- "Baseline, Kg > 0" ,
531- "Baseline, M=3 non-zero Kg" ,
532- "Baseline, M=3 zero Kg" ,
533- "Baseline, M!=I" ,
525+ # "Reform",
526+ # "Reform, baseline spending",
527+ # "Baseline, small open",
528+ # "Baseline, small open some periods",
529+ # "Baseline, delta_tau = 0",
530+ # "Baseline, Kg > 0",
531+ # "Baseline, M=3 non-zero Kg",
532+ # "Baseline, M=3 zero Kg",
533+ # "Baseline, M!=I",
534534 ],
535535)
536536def test_run_TPI_full_run (
@@ -580,8 +580,8 @@ def test_run_TPI_full_run(
580580
581581 # Need to run SS first to get results
582582 SS .ENFORCE_SOLUTION_CHECKS = True
583- # ss_outputs = SS.run_SS(p, client=dask_client)
584- ss_outputs = SS .run_SS (p , client = None )
583+ ss_outputs = SS .run_SS (p , client = dask_client )
584+ # ss_outputs = SS.run_SS(p, client=None)
585585
586586 if p .baseline :
587587 utils .mkdirs (os .path .join (p .baseline_dir , "SS" ))
@@ -622,8 +622,6 @@ def test_run_TPI_full_run(
622622 - v [: p .T , :, :]
623623 ).max (),
624624 )
625- # save test results to disk
626- pickle .dump (test_dict , open ("TPI_TESTING_vars.pkl" , "wb" ))
627625
628626 for k , v in expected_dict .items ():
629627 print ("Testing, " , k )
@@ -632,6 +630,15 @@ def test_run_TPI_full_run(
632630 "Diff = " ,
633631 np .abs (test_dict [VAR_NAME_MAPPING [k ]][: p .T ] - v [: p .T ]).max (),
634632 )
633+ if np .abs (
634+ test_dict [VAR_NAME_MAPPING [k ]][: p .T ] - v [: p .T ]
635+ ).max () > 1e-5 :
636+ # print the indices where the difference is large
637+ indices = np .where (
638+ np .abs (test_dict [VAR_NAME_MAPPING [k ]][: p .T ] - v [: p .T ])
639+ > 1e-5
640+ )
641+ print ("Indices with large difference:" , indices )
635642 assert np .allclose (
636643 test_dict [VAR_NAME_MAPPING [k ]][: p .T ],
637644 v [: p .T ],
@@ -646,6 +653,16 @@ def test_run_TPI_full_run(
646653 - v [: p .T , :, :]
647654 ).max (),
648655 )
656+ if np .abs (
657+ test_dict [VAR_NAME_MAPPING [k ]][: p .T , :, :] - v [: p .T , :, :]
658+ ).max () > 1e-5 :
659+ # print the indices where the difference is large
660+ indices = np .where (
661+ np .abs (
662+ test_dict [VAR_NAME_MAPPING [k ]][: p .T , :, :] - v [: p .T , :, :]
663+ ) > 1e-5
664+ )
665+ print ("Indices with large difference:" , indices )
649666 assert np .allclose (
650667 test_dict [VAR_NAME_MAPPING [k ]][: p .T , :, :],
651668 v [: p .T , :, :],
0 commit comments