Skip to content

Fix dependencies, update doc workflow#146

Merged
rickecon merged 45 commits intoPSLmodels:masterfrom
jdebacker:fix_dep
Apr 4, 2026
Merged

Fix dependencies, update doc workflow#146
rickecon merged 45 commits intoPSLmodels:masterfrom
jdebacker:fix_dep

Conversation

@jdebacker
Copy link
Copy Markdown
Member

@jdebacker jdebacker commented Apr 2, 2026

This PR does the following:

  1. Replaces the no-longer-maintained pandas-datareader package with the fredapi package in macro_params.py.
  2. Updates the workflow for creating the exogenous parameters chapter of the Jupyter Book so it can be easily updated for new default parameter values.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 17.91045% with 55 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.73%. Comparing base (c2a637a) to head (b805ee8).

Files with missing lines Patch % Lines
ogusa/update_baseline.py 0.00% 31 Missing ⚠️
ogusa/macro_params.py 15.38% 11 Missing ⚠️
ogusa/psid_data_setup.py 14.28% 6 Missing ⚠️
ogusa/utils.py 37.50% 5 Missing ⚠️
ogusa/calibrate.py 60.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (c2a637a) and HEAD (b805ee8). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (c2a637a) HEAD (b805ee8)
unittests 4 2
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #146       +/-   ##
===========================================
- Coverage   45.69%   28.73%   -16.96%     
===========================================
  Files          18       19        +1     
  Lines        1416     1472       +56     
===========================================
- Hits          647      423      -224     
- Misses        769     1049      +280     
Flag Coverage Δ
unittests 28.73% <17.91%> (-16.96%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ogusa/__init__.py 100.00% <100.00%> (ø)
ogusa/estimate_beta_j.py 19.73% <ø> (ø)
ogusa/get_micro_data.py 94.11% <100.00%> (+0.08%) ⬆️
ogusa/labor.py 0.00% <ø> (ø)
ogusa/psid_summ_stats.py 0.00% <ø> (ø)
ogusa/calibrate.py 38.62% <60.00%> (-0.12%) ⬇️
ogusa/utils.py 38.70% <37.50%> (-48.36%) ⬇️
ogusa/psid_data_setup.py 8.23% <14.28%> (-90.56%) ⬇️
ogusa/macro_params.py 17.94% <15.38%> (-82.06%) ⬇️
ogusa/update_baseline.py 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jdebacker jdebacker requested a review from rickecon April 2, 2026 22:04
@rickecon
Copy link
Copy Markdown
Member

rickecon commented Apr 3, 2026

@jdebacker. I reviewed all the changes in this PR, and they look good. I am just running the example script on my local machine to make sure that works, because these are big-ish changes. Also, will you please do the following two things:

  • Update the version in setup.py and ogusa/__init__.py, as well as make a CHANGELOG.md entry.
  • Get rid of the pandas-datareader dependency in setup.py

@rickecon
Copy link
Copy Markdown
Member

rickecon commented Apr 3, 2026

@jdebacker. In my local run of run_ogusa.py, the baseline steady state solved, but the transition path failed in the first iteration:

Baseline steady-state output

GE loop errors = ['-8.304e-13', '-9.965e-13', '5.402e-12', '0.000e+00', '-2.202e-11', '-6.796e-12', '1.424e-11', '2.831e-11', '1.292e-13', '-1.365e-11', '5.170e-13', '8.171e-14', '7.231e-14', '-5.164e-14', '7.274e-12', '-1.478e-12', '1.704e-12']
Iteration: 1  Distance: 9.176408759076916e-10
SS debt = 1.5292915044715172, 0.011644556413175166
IO: (1, 1), C: (1,)
Foreign debt holdings = 0.6117166017886069
Foreign capital holdings = 0.09147387292175035
resource constraint: [-1.10124757e-12]
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.
Maximum error in labor FOC = 2.1183055309847987e-13
Maximum error in savings FOC = 1.2523315717771766e-13
/opt/anaconda3/envs/ogusa-dev/lib/python3.13/site-packages/ogcore/SS.py:1612: 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/OG-USA/examples/Example/OUTPUT_BASELINE/SS/SS_vars.pkl

Baseline transition path output

Government spending breakpoints are tG1: 20; and tG2: 256
Maximum debt ratio:  nan
w diff: 0.011979075422237528, -0.05648900445826088
r diff: 0.006053370560325275, -0.001275065511515315
r_p diff: nan, nan
p_m diff: 0.0, 0.0
BQ diff: nan, nan
TR diff: 0.00044172519871962107, -0.002066868820236774
Iteration: 1
Distance: nan
Max absolute value resource constraint error: nan
Checking time path for violations of constraints.
Max Euler error, savings: nan
Max Euler error labor supply: nan
Traceback (most recent call last):
  File "/Users/richardevans/Docs/Economics/OSE/OG/OG-USA/./examples/run_ogusa.py", line 171, in <module>
    main()
    ~~~~^^
  File "/Users/richardevans/Docs/Economics/OSE/OG/OG-USA/./examples/run_ogusa.py", line 71, in main
    runner(p, time_path=True, client=client)
    ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/envs/ogusa-dev/lib/python3.13/site-packages/ogcore/execute.py", line 69, in runner
    tpi_output = TPI.run_TPI(p, client=client)
  File "/opt/anaconda3/envs/ogusa-dev/lib/python3.13/site-packages/ogcore/TPI.py", line 1545, in run_TPI
    raise RuntimeError(
        "Transition path equlibrium not found " + "(eulers)"
    )
RuntimeError: Transition path equlibrium not found (eulers)
2026-04-03 02:34:54,129 - distributed.scheduler - WARNING - Removing worker 'tcp://127.0.0.1:64933' caused the cluster to lose already computed task(s), which will be recomputed elsewhere: {'inner_loop-a87715e08d2db1cbe3829864223e4e70'} (stimulus_id='handle-worker-cleanup-1775205294.129771')
2026-04-03 02:34:54,130 - distributed.scheduler - WARNING - Removing worker 'tcp://127.0.0.1:64934' caused the cluster to lose already computed task(s), which will be recomputed elsewhere: {'inner_loop-4753171709a3945404eb27b5c761dc9d', 'inner_loop-8cbf08de778b0679988d2ad51f330894'} (stimulus_id='handle-worker-cleanup-1775205294.130008')
2026-04-03 02:34:54,130 - distributed.scheduler - ERROR - Removing worker 'tcp://127.0.0.1:64934' caused the cluster to lose scattered data, which can't be recovered: {'Specifications-dbe492ffcff95ed489378a41694fa77a'} (stimulus_id='handle-worker-cleanup-1775205294.130008')
2026-04-03 02:34:54,130 - distributed.scheduler - WARNING - Removing worker 'tcp://127.0.0.1:64932' caused the cluster to lose already computed task(s), which will be recomputed elsewhere: {'inner_loop-5c8c4f395cfa4adda31562cdbddfb944', 'inner_loop-b392d9ee8b86af28a52ab16521419444'} (stimulus_id='handle-worker-cleanup-1775205294.130642')
2026-04-03 02:34:54,131 - distributed.scheduler - WARNING - Removing worker 'tcp://127.0.0.1:64931' caused the cluster to lose already computed task(s), which will be recomputed elsewhere: {'inner_loop-5a36cfc3191c59b894b0858b1383fe7b'} (stimulus_id='handle-worker-cleanup-1775205294.1313338')
2026-04-03 02:34:54,132 - distributed.scheduler - WARNING - Removing worker 'tcp://127.0.0.1:64936' caused the cluster to lose already computed task(s), which will be recomputed elsewhere: {'inner_loop-2e0528e4b65cc4c39a8bd907117f10ba'} (stimulus_id='handle-worker-cleanup-1775205294.13217')
2026-04-03 02:34:54,132 - distributed.scheduler - WARNING - Removing worker 'tcp://127.0.0.1:64935' caused the cluster to lose already computed task(s), which will be recomputed elsewhere: {'inner_loop-851fa19f47e82421cd9c9b80e2414af7', 'inner_loop-c343091fa886e4c68ef8a347a74e6d73'} (stimulus_id='handle-worker-cleanup-1775205294.132638')
2026-04-03 02:34:54,132 - distributed.scheduler - WARNING - Removing worker 'tcp://127.0.0.1:64930' caused the cluster to lose already computed task(s), which will be recomputed elsewhere: {'inner_loop-c246e4dc5c3e4143d8ad8fcf661b21d8'} (stimulus_id='handle-worker-cleanup-1775205294.13287')

@jdebacker jdebacker changed the title Fix dependencies, update baseline, update doc workflow Fix dependencies, update doc workflow Apr 3, 2026
@jdebacker
Copy link
Copy Markdown
Member Author

@rickecon I had the same issue with the example script under the new baseline.

I've now reverted my changes to keep the baseline the same as on master. My proposal is that we handle the baseline update in another PR with a new minor version release. It may take some time to see what amongst the changes is causing the solver to fail.

@rickecon
Copy link
Copy Markdown
Member

rickecon commented Apr 3, 2026

@jdebacker. This looks good now. I am just running the example script locally to make sure it works.

@rickecon
Copy link
Copy Markdown
Member

rickecon commented Apr 3, 2026

@jdebacker. I ran this locally, and everything solved smoothly:

Baseline steady-state equilibrium solution

GE loop errors = ['-6.939e-18', '1.388e-17', '1.110e-15', '0.000e+00', '-1.998e-15', '4.052e-15', '-8.070e-15', '1.041e-17', '1.626e-14', '8.053e-15', '-1.624e-14', '8.674e-19', '3.927e-15', '1.956e-15', '-3.986e-15', '-2.082e-16', '-8.327e-17']
Iteration: 1  Distance: 6.296030196148067e-13
SS debt = 1.5201313855150633, 0.00991849955618566
IO: (1, 1), C: (1,)
Foreign debt holdings = 0.6080525542060253
Foreign capital holdings = 0.2497763919547643
resource constraint: [-2.70616862e-16]
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.
Maximum error in labor FOC = 5.164757510556228e-13
Maximum error in savings FOC = 1.5062950886601811e-13
/opt/anaconda3/envs/ogusa-dev/lib/python3.13/site-packages/ogcore/SS.py:1612: 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/OG-USA/examples/Example/OUTPUT_BASELINE/SS/SS_vars.pkl

Baseline transition path equilibrium solution (34 min, 8.9 sec)

Maximum debt ratio:  4.629781096618369
w diff: 1.2054127036531526e-06, -2.930279177526529e-06
r diff: 3.591789073317808e-07, -1.2839201188330485e-07
r_p diff: 1.5524900824626098e-07, -7.544063464898221e-08
p_m diff: 0.0, 0.0
BQ diff: 1.4817858106849768e-07, -1.3466771888251405e-07
TR diff: 7.036731684839648e-08, -1.2830673645769508e-07
Iteration: 23
Distance: 7.1845746647290635e-06
Max absolute value resource constraint error: 1.7095503302977377e-06
Checking time path for violations of constraints.
Max Euler error, savings: 3.439915019498585e-12
Max Euler error labor supply: 1.6129320101754274e-12
Time path iteration complete.
It took 2048.9339439868927 seconds to get that part done.
run time =  2048.9368340969086

Reform steady-state equilibrium solution

GE loop errors = ['7.633e-17', '3.712e-15', '3.242e-14', '0.000e+00', '-1.678e-13', '9.274e-13', '8.344e-15', '2.768e-12', '9.014e-15', '1.549e-14', '3.234e-14', '-2.277e-13', '4.575e-13', '-2.248e-13', '-2.280e-13', '-1.681e-14']
Iteration: 1  Distance: 7.259455652044168e-11
SS debt = 1.5094310642248858, 0.0098486824778864
IO: (1, 1), C: (1,)
Foreign debt holdings = 0.6037724256899544
Foreign capital holdings = 0.22158496521790805
resource constraint: [-7.88952237e-15]
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.
Maximum error in labor FOC = 5.235811784132238e-13
Maximum error in savings FOC = 1.4724332864091139e-13
/opt/anaconda3/envs/ogusa-dev/lib/python3.13/site-packages/ogcore/SS.py:1612: 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/OG-USA/examples/Example/OUTPUT_REFORM/SS/SS_vars.pkl

Reform transition path equilibrium solution (36 min, 34.9 sec)

Maximum debt ratio:  4.48890938793328
w diff: 1.2186245965661868e-06, -2.743236733548926e-06
r diff: 3.3358178634645963e-07, -1.294173499546969e-07
r_p diff: 1.4505535241710055e-07, -7.557185308093572e-08
p_m diff: 0.0, 0.0
BQ diff: 1.4590577094783508e-07, -1.2516245286378624e-07
TR diff: 6.855694384411137e-08, -1.2410790189987253e-07
Iteration: 23
Distance: 6.844413585924205e-06
Max absolute value resource constraint error: 1.566234729660776e-06
Checking time path for violations of constraints.
Max Euler error, savings: 3.028688411177427e-12
Max Euler error labor supply: 1.5338841308221163e-12
Time path iteration complete.
It took 2194.8850560188293 seconds to get that part done.
run time =  2194.8871669769287
Percentage changes in aggregates: Year                    Variable  2026  2027  2028  2029  2030  2031  2032  2033  2034  2035  2026-2035    SS
0                    GDP ($Y_t$) -0.76 -0.73 -0.70 -0.67 -0.65 -0.62 -0.59 -0.58 -0.56 -0.55      -0.64 -0.70
1            Consumption ($C_t$) -0.32 -0.46 -0.44 -0.48 -0.51 -0.54 -0.55 -0.57 -0.58 -0.59      -0.50 -0.94
2          Capital Stock ($K_t$) -1.84 -1.84 -1.81 -1.79 -1.76 -1.72 -1.67 -1.66 -1.65 -1.63      -1.74 -2.21
3                  Labor ($L_t$) -0.09 -0.05 -0.01  0.02  0.04  0.06  0.08  0.10  0.11  0.11       0.04  0.23
4     Real interest rate ($r_t$) -2.48 -2.31 -2.19 -2.08 -1.99 -1.91 -1.85 -1.84 -1.84 -1.85      -2.02 -0.97
5            Wage rate ($w_{t}$) -0.67 -0.68 -0.69 -0.69 -0.69 -0.68 -0.67 -0.67 -0.67 -0.67      -0.68 -0.93

@rickecon
Copy link
Copy Markdown
Member

rickecon commented Apr 3, 2026

I created a new conda environment and ran make documentation and it failed. I got the same failure running jb build ./docs/book. I think this is the error we have had in other repos with the Jupyter book headings. I will make a PR to this PR.

File "/opt/anaconda3/envs/ogusa-dev/lib/python3.13/site-packages/jupyter_client/kernelspec.py", line 287, in get_kernel_spec
    raise NoSuchKernel(kernel_name)
jupyter_client.kernelspec.NoSuchKernel: No such kernel named ogusa-dev

@rickecon
Copy link
Copy Markdown
Member

rickecon commented Apr 3, 2026

@jdebacker. I've fixed the documentation issues in a PR to your branch. But I am also having two local tests fail in test_get_micro_data.py, one having to do with the PUF file test_puf_path() and one having to do with the TMD file test_tmd_path(). I'm sure I can fix the TMD path issue by updating where I put my TMD files. But I am confused about the PUF path issue.

(ogusa-dev) richardevans@Richards-MacBook-Pro-2 OG-USA % make test
pytest -m 'not local' --cov=./ --cov-report=xml
================================================= test session starts ==================================================
platform darwin -- Python 3.13.12, pytest-9.0.2, pluggy-1.6.0
rootdir: /Users/richardevans/Docs/Economics/OSE/OG/OG-USA
configfile: pytest.ini
testpaths: ./tests
plugins: cov-7.1.0, xdist-3.8.0, anyio-4.13.0
collected 42 items / 10 deselected / 32 selected                                                                       

tests/test_calibrate.py ....s                                                                                    [ 15%]
tests/test_get_micro_data.py ..FF........                                                                        [ 53%]
tests/test_income.py ...........                                                                                 [ 87%]
tests/test_macro_params.py s                                                                                     [ 90%]
tests/test_psid_data_setup.py s                                                                                  [ 93%]
tests/test_wealth.py ..                                                                                          [100%]

======================================================= FAILURES =======================================================
____________________________________________________ test_puf_path _____________________________________________________

    @pytest.mark.needs_puf
    def test_puf_path():
        """
        Check that setting `data` to "puf" uses the puf file
        """
        start_year = 2016
        reform = {"II_em": {2017: 10000}}
    
        # puf.csv in ogusa/
        if os.path.exists(PUF_PATH):
>           calc = get_micro_data.get_calculator(
                start_year, iit_reform=reform, data=PUF_PATH
            )

tests/test_get_micro_data.py:81: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
ogusa/get_micro_data.py:91: in get_calculator
    calc1 = Calculator(records=records1, policy=policy1)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/opt/anaconda3/envs/ogusa-dev/lib/python3.13/site-packages/taxcalc/calculator.py:105: in __init__
    if self.__policy.current_year < self.__records.data_year:
                                    ^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <taxcalc.records.Records object at 0x3455d7610>

    @property
    def data_year(self):
        """
        Data class original data year property.
        """
>       return self.__data_year
               ^^^^^^^^^^^^^^^^
E       AttributeError: 'Records' object has no attribute '_Data__data_year'

/opt/anaconda3/envs/ogusa-dev/lib/python3.13/site-packages/taxcalc/data.py:132: AttributeError
------------------------------------------------- Captured stdout call -------------------------------------------------
Using PUF
____________________________________________________ test_tmd_path _____________________________________________________

    @pytest.mark.needs_tmd
    def test_tmd_path():
        """
        Check that setting `data` to "tmd" uses the tmd file
        """
        start_year = 2016
        reform = {"II_em": {2017: 10000}}
    
        if os.path.exists(os.path.join(TMD_DIR, "tmd.csv.gz")):
            calc = get_micro_data.get_calculator(
                start_year,
                iit_reform=reform,
                data=Path(TMD_DIR, "tmd.csv.gz"),
                weights=Path(TMD_DIR, "tmd_weights.csv.gz"),
                gfactors=Path(TMD_DIR, "tmd_growfactors.csv"),
                records_start_year=Records.TMDCSV_YEAR,
            )
            # blind_head is only in the CPS file and e00700 is only in the
            # PUF.  See taxcalc/records_variables.json
            assert calc.array("e00700").sum() > 0
        # we do not have puf.csv
        else:
            # make sure TC is looking for tmd.csv
            with pytest.raises((IOError, ValueError), match="tmd.csv.gz"):
>               get_micro_data.get_calculator(
                    start_year,
                    iit_reform=reform,
                    data=Path(TMD_DIR, "tmd.csv.gz"),
                    weights=Path(TMD_DIR, "tmd_weights.csv.gz"),
                    gfactors=Path(TMD_DIR, "tmd_growfactors.csv"),
                    records_start_year=Records.TMDCSV_YEAR,
                )

tests/test_get_micro_data.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
ogusa/get_micro_data.py:69: in get_calculator
    records1 = Records.tmd_constructor(
/opt/anaconda3/envs/ogusa-dev/lib/python3.13/site-packages/taxcalc/records.py:263: in tmd_constructor
    growfactors = GrowFactors(growfactors_filename=str(growfactors))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <taxcalc.growfactors.GrowFactors object at 0x34588f950>
growfactors_filename = '/Users/richardevans/Docs/Economics/OSE/OG/OG-USA/tests/../tmd_growfactors.csv'

    def __init__(self, growfactors_filename=None):
        # read grow factors from specified growfactors_filename
        gfdf = pd.DataFrame()
        if growfactors_filename is None:
            # read puf/cps growfactors from package
            gfdf = read_egg_csv(GrowFactors.PACKAGE_FILE_NAMES[0],
                                index_col='YEAR')  # pragma: no cover
        elif isinstance(growfactors_filename, str):
            if growfactors_filename in GrowFactors.PACKAGE_FILE_NAMES:
                # read growfactors from package
                gfdf = read_egg_csv(growfactors_filename,
                                    index_col='YEAR')  # pragma: no cover
            else:
                if os.path.isfile(growfactors_filename):
                    gfdf = pd.read_csv(growfactors_filename, index_col='YEAR')
                else:  # file does not exist
                    msg = (
                        f'growfactors file {growfactors_filename} '
                        'does not exist'
                    )
>                   raise ValueError(msg)
E                   ValueError: growfactors file /Users/richardevans/Docs/Economics/OSE/OG/OG-USA/tests/../tmd_growfactors.csv does not exist

/opt/anaconda3/envs/ogusa-dev/lib/python3.13/site-packages/taxcalc/growfactors.py:74: ValueError

During handling of the above exception, another exception occurred:

    @pytest.mark.needs_tmd
    def test_tmd_path():
        """
        Check that setting `data` to "tmd" uses the tmd file
        """
        start_year = 2016
        reform = {"II_em": {2017: 10000}}
    
        if os.path.exists(os.path.join(TMD_DIR, "tmd.csv.gz")):
            calc = get_micro_data.get_calculator(
                start_year,
                iit_reform=reform,
                data=Path(TMD_DIR, "tmd.csv.gz"),
                weights=Path(TMD_DIR, "tmd_weights.csv.gz"),
                gfactors=Path(TMD_DIR, "tmd_growfactors.csv"),
                records_start_year=Records.TMDCSV_YEAR,
            )
            # blind_head is only in the CPS file and e00700 is only in the
            # PUF.  See taxcalc/records_variables.json
            assert calc.array("e00700").sum() > 0
        # we do not have puf.csv
        else:
            # make sure TC is looking for tmd.csv
>           with pytest.raises((IOError, ValueError), match="tmd.csv.gz"):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           AssertionError: Regex pattern did not match.
E             Expected regex: 'tmd.csv.gz'
E             Actual message: 'growfactors file /Users/richardevans/Docs/Economics/OSE/OG/OG-USA/tests/../tmd_growfactors.csv does not exist'

tests/test_get_micro_data.py:122: AssertionError
...
=============================================== short test summary info ================================================
FAILED tests/test_get_micro_data.py::test_puf_path - AttributeError: 'Records' object has no attribute '_Data__data_year'
FAILED tests/test_get_micro_data.py::test_tmd_path - AssertionError: Regex pattern did not match.
==================== 2 failed, 27 passed, 3 skipped, 10 deselected, 13 warnings in 91.72s (0:01:31) ====================

@rickecon
Copy link
Copy Markdown
Member

rickecon commented Apr 4, 2026

@jdebacker. This ended up being a hefty PR. Thanks for getting it moving. I am merging now.

Updated version date and added new features and fixes.
@rickecon rickecon merged commit 881daf1 into PSLmodels:master Apr 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants