PolicyEngine / PolicyEngine/policyengine-us

ParameterNotFoundError when running 2022 computations using default dataset

Open
#4,099 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
162
Forks
212
Avg merge
3d 3h
Merged PRs (30d)
97

Description

The below code produces this error ([notebook](https://colab.research.google.com/drive/1JwUUIXn-MBbXTFrtuO47Vo4i204oQGyZ?usp=sharing)):
>ParameterNotFoundError: The parameter 'gov.states.dc.dhs.tanf.need_standard.main.16' was not found in the 2022-01-01 tax and benefit system.

But it works when using `dataset="cps_2022"`. Maybe this is more of a `core` issue, but we should give more intuitive error messages.

```python
from policyengine_us import Microsimulation
from policyengine_core.periods import instant
from policyengine_core.reforms import Reform
import pandas as pd

def use_reported_state_tax(parameters):
parameters.simulation.reported_state_income_tax.update(start=instant("2022-01-01"), stop=instant("2030-12-31"), value=True)
return parameters

class baseline_reform(Reform):
def apply(self):
self.modify_parameters(use_reported_state_tax)

baseline = Microsimulation(reform=baseline_reform)
baseline.calc("snap", period=2022).sum()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.