PolicyEngine / policyengine-us-data

A package to create representative microdata for PolicyEngine US.
https://policyengine.github.io/policyengine-us-data/
1 stars 2 forks source link

Using enhanced CPS 2024 requires building rather than downloading release #28

Closed PavelMakarchuk closed 1 month ago

PavelMakarchuk commented 2 months ago

This requires PUF 2015 - which is restricted

PavelMakarchuk commented 2 months ago
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Cell In[13], [line 3](vscode-notebook-cell:?execution_count=13&line=3)
      [1](vscode-notebook-cell:?execution_count=13&line=1) results = []
      [2](vscode-notebook-cell:?execution_count=13&line=2) for name, reform in reforms.items():
----> [3](vscode-notebook-cell:?execution_count=13&line=3)     impact = calculate_budgetary_impact(reform, year)
      [4](vscode-notebook-cell:?execution_count=13&line=4)     results.append({"Reform": name, "Budgetary Impact ($)": impact})
      [6](vscode-notebook-cell:?execution_count=13&line=6) # Create a DataFrame and display results

Cell In[11], [line 3](vscode-notebook-cell:?execution_count=11&line=3)
      [2](vscode-notebook-cell:?execution_count=11&line=2) def calculate_budgetary_impact(reform, year):
----> [3](vscode-notebook-cell:?execution_count=11&line=3)     baseline = Microsimulation(dataset = "enhanced_cps_202[4](vscode-notebook-cell:?execution_count=11&line=4)")
      4     baseline_income = baseline.calculate("household_net_income", period=year, map_to="household")
      [6](vscode-notebook-cell:?execution_count=11&line=6)     reformed = Microsimulation(reform=reform, dataset = "enhanced_cps_2024")

File ~/policyengine-us/policyengine_us/system.py:140, in Microsimulation.__init__(self, *args, **kwargs)
    [139](https://file+.vscode-resource.vscode-cdn.net/Users/pavelmakarchuk/fsa3.0/~/policyengine-us/policyengine_us/system.py:139) def __init__(self, *args, **kwargs):
--> [140](https://file+.vscode-resource.vscode-cdn.net/Users/pavelmakarchuk/fsa3.0/~/policyengine-us/policyengine_us/system.py:140)     super().__init__(*args, **kwargs)
    [142](https://file+.vscode-resource.vscode-cdn.net/Users/pavelmakarchuk/fsa3.0/~/policyengine-us/policyengine_us/system.py:142)     reform = create_structural_reforms_from_parameters(
    [143](https://file+.vscode-resource.vscode-cdn.net/Users/pavelmakarchuk/fsa3.0/~/policyengine-us/policyengine_us/system.py:143)         self.tax_benefit_system.parameters, year_start
    [144](https://file+.vscode-resource.vscode-cdn.net/Users/pavelmakarchuk/fsa3.0/~/policyengine-us/policyengine_us/system.py:144)     )
    [145](https://file+.vscode-resource.vscode-cdn.net/Users/pavelmakarchuk/fsa3.0/~/policyengine-us/policyengine_us/system.py:145)     if reform is not None:

File ~/anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_core/simulations/simulation.py:161, in Simulation.__init__(self, tax_benefit_system, populations, situation, dataset, reform, trace)
    [157](https://file+.vscode-resource.vscode-cdn.net/Users/pavelmakarchuk/fsa3.0/~/anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_core/simulations/simulation.py:157)         dataset = Dataset.from_file(
...
     [27](https://file+.vscode-resource.vscode-cdn.net/Users/pavelmakarchuk/fsa3.0/~/anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_us_data/datasets/puf/irs_puf.py:27)     raise FileNotFoundError(
     [28](https://file+.vscode-resource.vscode-cdn.net/Users/pavelmakarchuk/fsa3.0/~/anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_us_data/datasets/puf/irs_puf.py:28)         f"PUF demographics file not found at {puf_demographics_file_path}. Either put it there, or change {Path(__file__)} point to a different path."
     [29](https://file+.vscode-resource.vscode-cdn.net/Users/pavelmakarchuk/fsa3.0/~/anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_us_data/datasets/puf/irs_puf.py:29)     )

FileNotFoundError: PUF file not found at /Users/pavelmakarchuk/anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_us_data/data_storage/puf_2015.csv. Either put it there, or change /Users/pavelmakarchuk/anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_us_data/datasets/puf/irs_puf.py point to a different path.
nikhilwoodruff commented 1 month ago

This is fixed now no?

PavelMakarchuk commented 1 month ago

Yep