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

Patch structural reforms #5401

Merged
merged 5 commits into from
Dec 13, 2024
Merged

Patch structural reforms #5401

merged 5 commits into from
Dec 13, 2024

Conversation

anth-volk
Copy link
Contributor

Fixes #5400.

This is a temporary patch for structural reforms failing when their parameters are initialized on a date other than 2024-01-01. This is meant to be supplanted by a refactor of structural reforms, which we aim to do in the coming couple of months.

The root of the issue is that, when instantiating a new Simulation or Microsimulation, structural reforms are conditionally applied based on the value of their parameters at a given date. This was previously hard-coded to 2024-01-01, and so in #5400, a reform instantiated in 2026 would not be treated as "active" by the Microsimulation initializer.

This code makes the start instant a passable argument, allowing a user to override the default behavior and, in the example in #5400, set "2026-01-01" as the start instant. The effect of this change is that structural reforms will require this parameter to be passed to both the baseline and reform Microsimulation instances that we typically initialize. If a given reform contains multiple structural reforms with multiple different start dates, multiple Microsimulation instances will be required.

@PavelMakarchuk
Copy link
Collaborator

Could you add an example usage notebook?

@MaxGhenis MaxGhenis merged commit 1a120ab into master Dec 13, 2024
3 checks passed
@MaxGhenis MaxGhenis deleted the fix/patch-struct-reforms branch December 13, 2024 23:42
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.

Structural reforms fail when not starting in 2024
3 participants