Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError when specifying reforms using multiple period styles #248

Closed
MaxGhenis opened this issue Aug 15, 2024 · 1 comment
Closed

ValueError when specifying reforms using multiple period styles #248

MaxGhenis opened this issue Aug 15, 2024 · 1 comment

Comments

@MaxGhenis
Copy link
Contributor

See https://colab.research.google.com/drive/1HCz8eYmgsHuXLE2MI9Wy6EPRJTHFrDjO#scrollTo=FJFklV92xjY6

reform = Reform.from_dict({
  "gov.irs.credits.ctc.refundable.fully_refundable": {
    "2024-01-01.2025-12-31": True
  },
  "gov.irs.credits.ctc.amount.base[0].amount": {
      "2023:10": 3000
  }
}, country_id="us")

reformed = Microsimulation(reform=reform)

throws

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-5-89dc63569c72>](https://localhost:8080/#) in <cell line: 10>()
      8 }, country_id="us")
      9 
---> 10 reformed = Microsimulation(reform=reform)
     11 
     12 reformed.calc("refundable_ctc", period=2024).sum()

6 frames
[/usr/local/lib/python3.10/dist-packages/policyengine_core/periods/helpers.py](https://localhost:8080/#) in raise_error(value)
    137             ]
    138         )
--> 139         raise ValueError(message)
    140 
    141     if value == "ETERNITY" or value == config.ETERNITY:

ValueError: Expected a period (eg. '2017', '2017-01', '2017-01-01', ...); got: '2023:10'.
Learn more about legal period formats in OpenFisca:
<https://openfisca.org/doc/coding-the-legislation/35_periods.html#periods-in-simulations>.
@MaxGhenis
Copy link
Contributor Author

Never mind, had to be year:2023:10 not 2023:10.

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

No branches or pull requests

1 participant