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

Consider using actual periods extended from OpenFisca-Core #34

Closed
nikhilwoodruff opened this issue Nov 12, 2020 · 4 comments
Closed

Consider using actual periods extended from OpenFisca-Core #34

nikhilwoodruff opened this issue Nov 12, 2020 · 4 comments

Comments

@nikhilwoodruff
Copy link
Collaborator

OpenFisca-Core only provides YEAR, MONTH and DAY periods, and all amounts in the FRS are weeklyised, so we've been using ETERNITY so far. It's not too much work to add additional periods in OpenFisca-Core, so if we did add the FRS periods, then we could make the API a lot more intuitive, and likely make analyses involving specific time periods, e.g. phase-in reforms, a lot easier and more accurate, as well as making the internal policy implementations a lot more readable, eliminating the need to internally weeklyise/yearlyise variables, e.g. income tax is calculated on yearlyised income and then weeklyised again - the taxes and benefits have many different payable time periods, e.g. most benefits pay weekly, some monthly, some are one-off and this would be respected by default if we used periods correctly. It would also fix #33 , because all variables would have the correct period metadata.

@MaxGhenis
Copy link
Collaborator

Cool, so would this involve a PR to openfisca-core? Looks like they added day a couple years ago (openfisca/openfisca-core#763), and there's more discussion of other periods in openfisca/openfisca-core#670.

@nikhilwoodruff
Copy link
Collaborator Author

I think so, though I'm not sure how OpenFisca would prefer this to be done. One potential problem caused by this is that for the DAY, WEEK and YEAR periods, you can specify a specific period (e.g. for MONTH, we can specify "2020-01", "2020-02", etc.) as well as the start date and length(e.g. for MONTH, we could write "month:2020-01-01", "month:2020-02-01"). Under the dd-mm-YYYY format, this second method wouldn't be possible for weeks or any other period, making them inconsistent from the rest of the periods. But I do think it would be worth it in OpenFisca-UK even if it isn't suitable for OpenFisca-Core to have WEEK, FOUR_WEEKS and maybe others.

@nikhilwoodruff
Copy link
Collaborator Author

Added some code in frs-tools that parses period codes: potentially opening up a way to de-weeklyise FRS figures if we decide to.

@nikhilwoodruff
Copy link
Collaborator Author

Closing as this is very old - we made the decision a while ago to use yearly periods.

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

2 participants