PSLmodels / OG-USA

Overlapping-generations macroeconomic model for evaluating fiscal policy in the United States
https://pslmodels.github.io/OG-USA/
Creative Commons Zero v1.0 Universal
19 stars 34 forks source link

Restrict Python 3.11 and update GitHub Actions #70

Closed rickecon closed 1 year ago

rickecon commented 1 year ago

Without a restriction python<3.11 the ogusa-dev conda environment can select Python 3.11, which causes errors in the run_og_usa.py example script. For example, when I remove my ogusa-dev conda environment and re-install it with the current OG-USA environment.yml and setup.py files, I get Python version 3.11. When I run the run_og_usa.py example script, I get the following error involvlng the paramtools package.

?

This PR:

I ran run_og_usa.py script, and I could only get the baseline steady state and transition path to run. Below is the output. The transition path steady state and transition path stalled right after estimating all the tax functions.

BASELINE STEADY STATE EQUILIBRIUM OUTPUT

SS debt =  1.4463530016523898 0.018388712496647683
IO:  (1, 1) , C:  (1,)
Steady state government spending is negative to satisfy budget
Checking constraints on capital, labor, and consumption.
    There were no violations of the constraints on labor  supply.
    There were no violations of the constraints on  consumption.

BASELINE TRANSITION PATH EQUILIBRIUM OUTPUT (3 hrs., 43 min, 2.46 sec)

Maximum debt ratio:  6.451672327492984
w diff:  2.289414695599845e-07 -8.884648126095129e-07
r diff:  1.321677115945219e-07 -3.388333776055408e-08
r_p diff:  6.086543438699188e-08 -4.8614574220395834e-08
p_m diff:  0.0 0.0
BQ diff:  1.3310186414844383e-07 -2.2981488996542954e-08
TR diff:  6.443340341832915e-08 -4.719288453358672e-07
Iteration: 24
    Distance: 9.092826606541283e-06
Max absolute value resource constraint error: 7.261091961863197e-07
Checking time path for violations of constraints.
Max Euler error, savings:  6.723677170583642e-12
Max Euler error labor supply:  2.8261837314857985e-12
Time path iteration complete.

cc: @jdebacker

rickecon commented 1 year ago

I ran the pytest command locally on my machine to run all tests and I got the following 4 failures in test_get_micro_data.py.

============================================================ test session starts ============================================================
platform darwin -- Python 3.10.11, pytest-7.3.2, pluggy-1.0.0
rootdir: /Users/richardevans/Docs/Economics/OSE/OG-USA
configfile: pytest.ini
testpaths: ogusa/tests
plugins: xdist-3.3.1, pep8-1.0.6
collected 45 items                                                                                                                          

ogusa/tests/test_calibrate.py ....                                                                                                    [  8%]
ogusa/tests/test_demographics.py ........                                                                                             [ 26%]
ogusa/tests/test_get_micro_data.py ..........FFFF                                                                                     [ 57%]
ogusa/tests/test_income.py ............                                                                                               [ 84%]
ogusa/tests/test_psid_data_setup.py ...                                                                                               [ 91%]
ogusa/tests/test_run_example.py .                                                                                                     [ 93%]
ogusa/tests/test_utils.py .                                                                                                           [ 95%]
ogusa/tests/test_wealth.py ..                                                                                                         [100%]

================================================================= FAILURES ==================================================================
========================================================== short test summary info ==========================================================
FAILED ogusa/tests/test_get_micro_data.py::test_get_data[Baseline] - AssertionError: DataFrame.iloc[:, 0] (column name="mtr_labinc") are different
FAILED ogusa/tests/test_get_micro_data.py::test_get_data[Reform] - AssertionError: DataFrame.iloc[:, 0] (column name="mtr_labinc") are different
FAILED ogusa/tests/test_get_micro_data.py::test_taxcalc_advance - assert False
FAILED ogusa/tests/test_get_micro_data.py::test_cap_inc_mtr - assert False
=========================================== 4 failed, 41 passed, 65 warnings in 788.37s (0:13:08) ===========================================
rickecon commented 1 year ago

@jdebacker. I tried running run_og_usa.py again and it finished the baseline steady-state and transition path equilibria. But it froze right after estimating the reform tax functions. Below are the respective baseline equilibrium outputs.

BASELINE STEADY-STATE EQUILIBRIUM OUTPUT

SS using initial guess factors for r and TR of 1.0 and 1.0 , respectively.
SS using initial guess factors for r and TR of 0.95 and 1.0 , respectively.
SS debt =  1.4463530016523898 0.018388712496647683
IO:  (1, 1) , C:  (1,)
Steady state government spending is negative to satisfy budget
Checking constraints on capital, labor, and consumption.
    There were no violations of the constraints on labor  supply.
    There were no violations of the constraints on  consumption.
JUST SAVED SS output to  /Users/richardevans/Docs/Economics/OSE/OG-USA/examples/OG-USA-Example/OUTPUT_BASELINE/SS/SS_vars.pkl

BASELINE TRANSITION PATH OUTPUT (48 min., 21.6 sec)

Maximum debt ratio:  6.451672327492984
w diff:  2.289414695599845e-07 -8.884648126095129e-07
r diff:  1.321677115945219e-07 -3.388333776055408e-08
r_p diff:  6.086543438699188e-08 -4.8614574220395834e-08
p_m diff:  0.0 0.0
BQ diff:  1.3310186414844383e-07 -2.2981488996542954e-08
TR diff:  6.443340341832915e-08 -4.719288453358672e-07
Iteration: 24
    Distance: 9.092826606541283e-06
Max absolute value resource constraint error: 7.261091961863197e-07
Checking time path for violations of constraints.
Max Euler error, savings:  6.723677170583642e-12
Max Euler error labor supply:  2.8261837314857985e-12
Time path iteration complete.
It took 2901.5888860225677 seconds to get that part done.
run time =  2901.5889551639557

And here is the output where my computation freezes in the reform.

...
Year= 2028 Age= 85
Linearly interpolate previous blank tax functions
Fill in all remaining old age tax functions.
Finished tax function loop through 12 years and 80 ages per year.
Tax function estimation time: 32 min, 29.4 sec
ETR :  15  observations tagged as outliers.
ETR :  After second round,  30  observations tagged as outliers (cumulative).
MTRx :  5  observations tagged as outliers.
MTRx :  After second round,  7  observations tagged as outliers (cumulative).
MTRy :  3  observations tagged as outliers.
MTRy :  After second round,  3  observations tagged as outliers (cumulative).
Big S:  80
max age, min age:  100 21
making dir:  /Users/richardevans/Docs/Economics/OSE/OG-USA/examples/OG-USA-Example/OUTPUT_REFORM/SS
making dir:  /Users/richardevans/Docs/Economics/OSE/OG-USA/examples/OG-USA-Example/OUTPUT_REFORM/TPI
In runner, baseline is  False
Shape HH =  (80, 7) 80 7
Shape firm =  (1,) 1
Using previous solutions for SS
rickecon commented 1 year ago

@jdebacker. My last commit fixes an error in the run_og_usa.py example run script that is weird. The run script currently has the following tax function estimation options in lines 48 and 49.

p.age_specific = False
p.tax_func_type = "GS"

But my reform runs were freezing after the tax function estimation because they were using the default specification of age_specific=True and estimating the age-specific tax functions. So my reform would estimate all the age specific tax functions and then not know what to do with the fact that the tax function specification was different in the reform. So I just added the same tax function options in the reform specification in run_og_usa.py.

p2.age_specific = False
p2.tax_func_type = "GS"
rickecon commented 1 year ago

@jdebacker. My reform run is getting a lot of dask distributed memory garbage collection warnings.

2023-06-23 07:44:41,818 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:44:41,881 - distributed.utils_perf - WARNING - full garbage collections took 46% CPU time recently (threshold: 10%)
2023-06-23 07:44:42,042 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:44:45,304 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:44:46,481 - distributed.utils_perf - WARNING - full garbage collections took 55% CPU time recently (threshold: 10%)
2023-06-23 07:44:46,686 - distributed.utils_perf - WARNING - full garbage collections took 64% CPU time recently (threshold: 10%)
2023-06-23 07:44:47,870 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
SS debt =  1.2679950360474388 0.016121096397915605
IO:  (1, 1) , C:  (1,)
Steady state government spending is negative to satisfy budget
Checking constraints on capital, labor, and consumption.
    There were no violations of the constraints on labor  supply.
    There were no violations of the constraints on  consumption.
/opt/anaconda3/envs/ogusa-dev/lib/python3.10/site-packages/ogcore/SS.py:1410: UserWarning: Warning: The combination of the tax policy you specified and your target debt-to-GDP ratio results in an infeasible amount of government spending in order to close the budget (i.e., G < 0)
  warnings.warn(
JUST SAVED SS output to  /Users/richardevans/Docs/Economics/OSE/OG-USA/examples/OG-USA-Example/OUTPUT_REFORM/SS/SS_vars.pkl
Government spending breakpoints are tG1:  20 ; and tG2: 256
2023-06-23 07:44:51,972 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:44:53,907 - distributed.utils_perf - WARNING - full garbage collections took 64% CPU time recently (threshold: 10%)
2023-06-23 07:44:55,108 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:44:56,995 - distributed.utils_perf - WARNING - full garbage collections took 64% CPU time recently (threshold: 10%)
2023-06-23 07:44:58,175 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:45:00,181 - distributed.utils_perf - WARNING - full garbage collections took 62% CPU time recently (threshold: 10%)
2023-06-23 07:45:00,213 - distributed.utils_perf - WARNING - full garbage collections took 64% CPU time recently (threshold: 10%)
Maximum debt ratio:  2.968486690371914
w diff:  0.051336683519460635 -0.006959840831162634
r diff:  0.0011522515876129583 -0.007662758778121025
r_p diff:  0.001079533892141632 -0.006073528859759696
p_m diff:  0.0 0.0
BQ diff:  0.0016047592573192049 -0.0009074904756908794
TR diff:  0.0006103036119148586 -0.002423754102763083
Iteration: 1
    Distance: 0.14580385800305812
2023-06-23 07:46:42,957 - distributed.utils_perf - WARNING - full garbage collections took 64% CPU time recently (threshold: 10%)
2023-06-23 07:46:44,156 - distributed.utils_perf - WARNING - full garbage collections took 62% CPU time recently (threshold: 10%)
Maximum debt ratio:  3.1311066936587664
w diff:  0.06359852213574024 -0.04531143113783198
r diff:  0.008147799269910425 -0.008598703977910703
r_p diff:  0.006929249907636277 -0.007316753676560109
p_m diff:  0.0 0.0
BQ diff:  0.0009849563527621757 -0.00037276840360970023
TR diff:  0.0017951886630893782 -0.0021931969544329785
Iteration: 2
    Distance: 0.19636253555705716
2023-06-23 07:48:23,263 - distributed.utils_perf - WARNING - full garbage collections took 64% CPU time recently (threshold: 10%)
2023-06-23 07:48:24,437 - distributed.utils_perf - WARNING - full garbage collections took 62% CPU time recently (threshold: 10%)
2023-06-23 07:48:25,705 - distributed.utils_perf - WARNING - full garbage collections took 64% CPU time recently (threshold: 10%)
Maximum debt ratio:  3.1224393185597226
w diff:  0.03668427566594934 -0.019373019672848324
r diff:  0.0033724675490602873 -0.0048555039199401975
r_p diff:  0.002713664028832559 -0.004081669236723269
p_m diff:  0.0 0.0
BQ diff:  0.0007352834334177806 -0.0002331162348627857
TR diff:  0.0012708722245144827 -0.0012259687582941645
Iteration: 3
    Distance: 0.1231441517620034
2023-06-23 07:50:04,928 - distributed.utils_perf - WARNING - full garbage collections took 62% CPU time recently (threshold: 10%)
2023-06-23 07:50:06,168 - distributed.utils_perf - WARNING - full garbage collections took 64% CPU time recently (threshold: 10%)
Maximum debt ratio:  3.124532582476448
w diff:  0.021243409493159948 -0.00948555882730373
r diff:  0.001617176364986997 -0.002744572798612739
r_p diff:  0.0012372983434438822 -0.002278886183241853
p_m diff:  0.0 0.0
BQ diff:  0.000488877157601774 -0.00018803637325953346
TR diff:  0.00085719833525226 -0.000784770705042119
Iteration: 4
    Distance: 0.0752081159801139
2023-06-23 07:51:39,267 - distributed.utils_perf - WARNING - full garbage collections took 64% CPU time recently (threshold: 10%)
2023-06-23 07:51:42,757 - distributed.utils_perf - WARNING - full garbage collections took 62% CPU time recently (threshold: 10%)
2023-06-23 07:51:45,462 - distributed.utils_perf - WARNING - full garbage collections took 64% CPU time recently (threshold: 10%)
2023-06-23 07:51:45,681 - distributed.utils_perf - WARNING - full garbage collections took 64% CPU time recently (threshold: 10%)
2023-06-23 07:51:46,901 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:51:50,214 - distributed.utils_perf - WARNING - full garbage collections took 10% CPU time recently (threshold: 10%)
Maximum debt ratio:  3.1250496519786224
w diff:  0.012288642519326931 -0.004653226657882925
r diff:  0.0007743537694099994 -0.0015591515310661025
r_p diff:  0.0005543659185133012 -0.0012789495411857088
p_m diff:  0.0 0.0
BQ diff:  0.00031055618175836533 -0.0001295743479871568
TR diff:  0.0005654793423878202 -0.0005008948391800258
Iteration: 5
    Distance: 0.04501248950920127
2023-06-23 07:53:22,568 - distributed.utils_perf - WARNING - full garbage collections took 10% CPU time recently (threshold: 10%)
2023-06-23 07:53:26,514 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:53:30,110 - distributed.utils_perf - WARNING - full garbage collections took 10% CPU time recently (threshold: 10%)
2023-06-23 07:53:30,773 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:53:33,544 - distributed.utils_perf - WARNING - full garbage collections took 10% CPU time recently (threshold: 10%)
2023-06-23 07:53:33,798 - distributed.utils_perf - WARNING - full garbage collections took 10% CPU time recently (threshold: 10%)
2023-06-23 07:53:34,952 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:53:36,194 - distributed.utils_perf - WARNING - full garbage collections took 10% CPU time recently (threshold: 10%)
2023-06-23 07:53:37,916 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:53:38,165 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:53:38,236 - distributed.utils_perf - WARNING - full garbage collections took 10% CPU time recently (threshold: 10%)
Maximum debt ratio:  3.1253904208401004
w diff:  0.007119826539125018 -0.002316335193773389
r diff:  0.0003751216779320915 -0.000887040855290025
r_p diff:  0.00024666272900414343 -0.0007186607114071097
p_m diff:  0.0 0.0
BQ diff:  0.00019160582276437146 -8.243290657554414e-05
TR diff:  0.00036702163254712095 -0.00031944356933594903
Iteration: 6
    Distance: 0.026659750911614002
2023-06-23 07:55:12,232 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:55:14,165 - distributed.utils_perf - WARNING - full garbage collections took 10% CPU time recently (threshold: 10%)
2023-06-23 07:55:17,255 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:55:17,257 - distributed.utils_perf - WARNING - full garbage collections took 10% CPU time recently (threshold: 10%)
2023-06-23 07:55:19,720 - distributed.utils_perf - WARNING - full garbage collections took 63% CPU time recently (threshold: 10%)
2023-06-23 07:55:20,550 - distributed.utils_perf - WARNING - full garbage collections took 10% CPU time recently (threshold: 10%)
Maximum debt ratio:  3.1257468796434407
w diff:  0.004112917804550031 -0.0011861038463241158
r diff:  0.00018679892886533378 -0.0005096039546959377
r_p diff:  0.0001110346857837799 -0.0004050613855594229
p_m diff:  0.0 0.0
BQ diff:  0.00011588098223012239 -5.8653528742538125e-05
TR diff:  0.00023613033790018806 -0.00020344245524716448
Iteration: 7
    Distance: 0.015637421534224143
rickecon commented 1 year ago

@jdebacker . My baseline and reform are now running in the run_og_usa.py script. Now I just need to fix the tests that are failing. Also, there are a bunch of file change issues that happen when we run all the pytest tests.

REFORM STEADY-STATE EQUILIBRIUM OUTPUT

SS debt =  1.2679950360474388 0.016121096397915605
IO:  (1, 1) , C:  (1,)
Steady state government spending is negative to satisfy budget
Checking constraints on capital, labor, and consumption.
    There were no violations of the constraints on labor  supply.
    There were no violations of the constraints on  consumption.
/opt/anaconda3/envs/ogusa-dev/lib/python3.10/site-packages/ogcore/SS.py:1410: UserWarning: Warning: The combination of the tax policy you specified and your target debt-to-GDP ratio results in an infeasible amount of government spending in order to close the budget (i.e., G < 0)

REFORM TRANSITION PATH OUTPUT (52 min., 7.0 sec.)

Maximum debt ratio:  3.1274686350922525
w diff:  1.188695406550977e-07 -7.233050114408002e-08
r diff:  1.2419567152477384e-08 -1.7856063884436058e-08
r_p diff:  7.612302135862059e-09 -1.5951703673244833e-08
p_m diff:  0.0 0.0
BQ diff:  8.902884895099772e-08 -1.050148176404142e-08
TR diff:  1.910691682649457e-08 -1.6540132471987157e-08
Iteration: 27
    Distance: 7.358946056709109e-06
Max absolute value resource constraint error: 1.3059501843826204e-07
Checking time path for violations of constraints.
Max Euler error, savings:  2.7211566333562587e-12
Max Euler error labor supply:  1.2994050280212832e-12
Time path iteration complete.
It took 3126.983248949051 seconds to get that part done.
run time =  3126.9833347797394
Percentage changes in aggregates: Year                    Variable   2021   2022   2023   2024   2025   2026   2027   2028   2029   2030  2021-2030     SS
0                    GDP ($Y_t$)  -7.94  -7.93  -8.06  -8.07  -7.99  -7.87  -7.72  -7.53  -7.31  -7.04      -7.76 -12.33
1            Consumption ($C_t$)  -8.30  -7.33  -9.33 -10.83 -11.55 -12.13 -12.62 -13.03 -13.39 -13.69     -11.18 -19.43
2          Capital Stock ($K_t$)  -1.35  -2.43  -3.67  -4.49  -4.99  -5.29  -5.43  -5.42  -5.26  -4.96      -4.24 -21.88
3                  Labor ($L_t$) -11.30 -10.76 -10.34  -9.94  -9.57  -9.23  -8.93  -8.65  -8.39  -8.14      -9.53  -6.72
4     Real interest rate ($r_t$) -18.51 -15.90 -13.34 -11.43 -10.08  -9.06  -8.34  -7.87  -7.63  -7.59     -10.64  20.48
5                      Wage rate   3.79   3.17   2.54   2.08   1.74   1.50   1.33   1.22   1.18   1.20       2.00  -6.02
rickecon commented 1 year ago

@jdebacker. When I run pytest, I get the following files that are written to the repository. Particularly concerning is the psid_lifetime_income.csv file that is modified by running the tests.

(ogusa-dev) richardevans@Richards-MacBook-Pro OG-USA % git status
On branch test
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   ogusa/data/PSID/psid_lifetime_income.csv

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    ogusa/data/PSID/first_stage_reg_results.pkl
    ogusa/micro_data_baseline.pkl
    ogusa/micro_data_policy.pkl
    ogusa_example_output.csv
jdebacker commented 1 year ago

@rickecon I agree that it is not good to have a tracked file updated when the pytest suite is run.

Looking at it, I don't know that psid_lifetime_income.csv needs to be checked into the repo at all -- it seems easy enough to replicate with the raw PSID files (psid1968to2015.RDataand psid1968to2017.RData), which are themselves in the repo .

I'm less worried about modifying untracked files, but I have no problem if those are deleted after the test runs to keep things tidy.

rickecon commented 1 year ago

@jdebacker. I'll start working on those four test_get_micro_data.py errors from my local tests and the one test_psid_data_setup.py error from the Windows/Python 3.10 CI tests.

rickecon commented 1 year ago

@jdebacker. These updates are now passing all the tests on my local machine. However, there is failed test on the GH Action CI tests for ubuntu-latest, Python 3.10, macos-latest, Python 3.9, macos-latest, Python 3.10 in the one test_psid_data_setup.py test. I am currently running the tests on the other builds to see if they pass.

(ogusa-dev) richardevans@Richards-MacBook-Pro OG-USA % pytest
/opt/anaconda3/envs/ogusa-dev/lib/python3.10/site-packages/pep8.py:110: FutureWarning: Possible nested set at position 1
  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
============================= test session starts ==============================
platform darwin -- Python 3.10.11, pytest-7.3.2, pluggy-1.0.0
rootdir: /Users/richardevans/Docs/Economics/OSE/OG-USA
configfile: pytest.ini
testpaths: ogusa/tests
plugins: xdist-3.3.1, pep8-1.0.6
collected 45 items                                                             

ogusa/tests/test_calibrate.py ....                                       [  8%]
ogusa/tests/test_demographics.py ........                                [ 26%]
ogusa/tests/test_get_micro_data.py ..............                        [ 57%]
ogusa/tests/test_income.py ............                                  [ 84%]
ogusa/tests/test_psid_data_setup.py ...                                  [ 91%]
ogusa/tests/test_run_example.py .                                        [ 93%]
ogusa/tests/test_utils.py .                                              [ 95%]
ogusa/tests/test_wealth.py ..                                            [100%]
...
================= 45 passed, 65 warnings in 748.03s (0:12:28) ==================
rickecon commented 1 year ago

@jdebacker. I also verified that the full run_og_usa.py script runs on my local machine.

BASELINE STEADY-STATE EQUILIBRIUM OUTPUT

SS debt =  1.4463530016523898 0.018388712496647683
IO:  (1, 1) , C:  (1,)
Steady state government spending is negative to satisfy budget
Checking constraints on capital, labor, and consumption.
    There were no violations of the constraints on labor  supply.
    There were no violations of the constraints on  consumption.
JUST SAVED SS output to  /Users/richardevans/Docs/Economics/OSE/OG-USA/examples/OG-USA-Example/OUTPUT_BASELINE/SS/SS_vars.pkl

BASELINE TRANSITION PATH EQUILIBRIUM OUTPUT (49 min, 0.0 sec)

Maximum debt ratio:  6.451672327492984
w diff:  2.289414695599845e-07 -8.884648126095129e-07
r diff:  1.321677115945219e-07 -3.388333776055408e-08
r_p diff:  6.086543438699188e-08 -4.8614574220395834e-08
p_m diff:  0.0 0.0
BQ diff:  1.3310186414844383e-07 -2.2981488996542954e-08
TR diff:  6.443340341832915e-08 -4.719288453358672e-07
Iteration: 24
    Distance: 9.092826606541283e-06
Max absolute value resource constraint error: 7.261091961863197e-07
Checking time path for violations of constraints.
Max Euler error, savings:  6.723677170583642e-12
Max Euler error labor supply:  2.8261837314857985e-12
Time path iteration complete.
It took 2940.4853110313416 seconds to get that part done.
run time =  2940.48539018631

REFORM STEADY-STATE EQUILIBRIUM OUTPUT

SS debt =  1.2679950360474388 0.016121096397915605
IO:  (1, 1) , C:  (1,)
Steady state government spending is negative to satisfy budget
Checking constraints on capital, labor, and consumption.
    There were no violations of the constraints on labor  supply.
    There were no violations of the constraints on  consumption.
/opt/anaconda3/envs/ogusa-dev/lib/python3.10/site-packages/ogcore/SS.py:1410: UserWarning: Warning: The combination of the tax policy you specified and your target debt-to-GDP ratio results in an infeasible amount of government spending in order to close the budget (i.e., G < 0)
  warnings.warn(
JUST SAVED SS output to  /Users/richardevans/Docs/Economics/OSE/OG-USA/examples/OG-USA-Example/OUTPUT_REFORM/SS/SS_vars.pkl

REFORM TRANSITION PATH EQUILIBRIUM OUTPUT (56 min, 0.0 sec)

Maximum debt ratio:  3.1274686350922525
w diff:  1.188695406550977e-07 -7.233050114408002e-08
r diff:  1.2419567152477384e-08 -1.7856063884436058e-08
r_p diff:  7.612302135862059e-09 -1.5951703673244833e-08
p_m diff:  0.0 0.0
BQ diff:  8.902884895099772e-08 -1.050148176404142e-08
TR diff:  1.910691682649457e-08 -1.6540132471987157e-08
Iteration: 27
    Distance: 7.358946056709109e-06
Max absolute value resource constraint error: 1.3059501843826204e-07
Checking time path for violations of constraints.
Max Euler error, savings:  2.7211566333562587e-12
Max Euler error labor supply:  1.2994050280212832e-12
Time path iteration complete.
It took 3418.6699619293213 seconds to get that part done.
run time =  3418.670017004013
Percentage changes in aggregates: Year                    Variable   2021   2022  ...   2030  2021-2030     SS
0                    GDP ($Y_t$)  -7.94  -7.93  ...  -7.04      -7.76 -12.33
1            Consumption ($C_t$)  -8.30  -7.33  ... -13.69     -11.18 -19.43
2          Capital Stock ($K_t$)  -1.35  -2.43  ...  -4.96      -4.24 -21.88
3                  Labor ($L_t$) -11.30 -10.76  ...  -8.14      -9.53  -6.72
4     Real interest rate ($r_t$) -18.51 -15.90  ...  -7.59     -10.64  20.48
5                      Wage rate   3.79   3.17  ...   1.20       2.00  -6.02

[6 rows x 13 columns]
codecov-commenter commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: +0.50 :tada:

Comparison is base (955ae31) 78.36% compared to head (0b11439) 78.87%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #70 +/- ## ========================================== + Coverage 78.36% 78.87% +0.50% ========================================== Files 21 21 Lines 1382 1382 ========================================== + Hits 1083 1090 +7 + Misses 299 292 -7 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `78.87% <0.00%> (+0.50%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/PSLmodels/OG-USA/pull/70?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [ogusa/tests/test\_get\_micro\_data.py](https://app.codecov.io/gh/PSLmodels/OG-USA/pull/70?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2d1c2EvdGVzdHMvdGVzdF9nZXRfbWljcm9fZGF0YS5weQ==) | `83.95% <ø> (+2.46%)` | :arrow_up: | | [setup.py](https://app.codecov.io/gh/PSLmodels/OG-USA/pull/70?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-c2V0dXAucHk=) | `0.00% <0.00%> (ø)` | | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/PSLmodels/OG-USA/pull/70/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

rickecon commented 1 year ago

@jdebacker. I reran the tests with these new environment.yml and setup.py files, and everything passed locally.

(ogusa-dev) richardevans@Richards-MacBook-Pro OG-USA % pytest
/opt/anaconda3/envs/ogusa-dev/lib/python3.10/site-packages/pep8.py:110: FutureWarning: Possible nested set at position 1
  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
============================= test session starts ==============================
platform darwin -- Python 3.10.12, pytest-7.4.0, pluggy-1.2.0
rootdir: /Users/richardevans/Docs/Economics/OSE/OG-USA
configfile: pytest.ini
testpaths: ogusa/tests
plugins: xdist-3.3.1, pep8-1.0.6
collected 45 items                                                             

ogusa/tests/test_calibrate.py ....                                       [  8%]
ogusa/tests/test_demographics.py ........                                [ 26%]
ogusa/tests/test_get_micro_data.py ..............                        [ 57%]
ogusa/tests/test_income.py ............                                  [ 84%]
ogusa/tests/test_psid_data_setup.py ...                                  [ 91%]
ogusa/tests/test_run_example.py .                                        [ 93%]
ogusa/tests/test_utils.py .                                              [ 95%]
ogusa/tests/test_wealth.py ..                                            [100%]
...
================= 45 passed, 64 warnings in 820.60s (0:13:40) ==================
jdebacker commented 1 year ago

Great work @rickecon! All looks good to me. Merging.