Created
July 17, 2021 12:59
-
-
Save bonjourmauko/a4b229750ec6ba3bb677f18ba6a3eebc to your computer and use it in GitHub Desktop.
Example condition check rule with OpenFisca
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class basic_income_age_condition(Variable): | |
| value_type = bool | |
| entity = Person | |
| definition_period = MONTH | |
| label = "Age eligibility condition for basic income" | |
| reference = "https://law.gov.example/basic_income/eligibility/age" | |
| def formula(persons, period, parameters): | |
| input_age = persons("age", period) | |
| threshold = parameters(period).general.age_of_majority | |
| return input_age >= threshold |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment