Skip to content

Conversation

@nikhilwoodruff
Copy link
Collaborator

This adds the functionality to backdate the current parameters to the start of the year:

In [10]: baseline = Microsimulation()

In [11]: current = Microsimulation(use_current_parameters())

In [12]: baseline.simulation.tax_benefit_system.parameters.tax.national_insurance.class_1.thresholds.
    ...: primary_threshold
Out[12]: 
2021-04-06: 184
2020-04-06: 183
2019-04-06: 166
2018-04-06: 162
2017-04-06: 157
2016-04-06: 155
2015-04-06: 155
2010-01-01: 155

In [13]: current.simulation.tax_benefit_system.parameters.tax.national_insurance.class_1.thresholds.p
    ...: rimary_threshold
Out[13]: 
2022-01-01: 184
2021-01-01: 184
2020-04-06: 183
2019-04-06: 166
2018-04-06: 162
2017-04-06: 157
2016-04-06: 155
2015-04-06: 155
2010-01-01: 155

@nikhilwoodruff nikhilwoodruff self-assigned this Sep 7, 2021
Copy link
Collaborator

@MaxGhenis MaxGhenis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution. In the future could be good to include a test for this and potentially store the result as a file to avoid having to traverse the tree every time it's invoked, but as you said it's very little computation time so otherwise safer to use the latest values every time

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.

2 participants