Skip to content

Commit

Permalink
Added changelog, removed duplicate residence variable, rolled major v…
Browse files Browse the repository at this point in the history
…ersion number
  • Loading branch information
verbman committed Jun 15, 2018
1 parent 2be7143 commit fcd9c78
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 54 deletions.
22 changes: 11 additions & 11 deletions CHANGELOG.md
@@ -1,22 +1,22 @@
# Changelog

# 3.0.1 - [#21](https://github.com/ServiceInnovationLab/openfisca-aotearoa/pull/21)
# 4.0.0 - [#22](https://github.com/ServiceInnovationLab/openfisca-aotearoa/pull/22)

* Tax and benefit system evolution. Minor change.
* Impacted periods: none
* Impacted areas: `variables/rates_rebates`
* Tax and benefit system evolution. Major change.
* Impacted periods: all
* Impacted areas: `entities.families, tests/best_start, tests/family_scheme, tests/working_for_families, variables/demographics, variables/rates_rebates, variables/entitlements/income_tax/best_start.py, variables/entitlements/income_tax/family_scheme.py, variables/entitlements/income_tax/working_for_families.py`
* Details:
- removed extraneous rates_rebates variable file
- - - -
These changes:
- Change non-functional parts of this repository

- removed extraneous rates_rebates variable file,
- added `variables/demographics` section with variables (`date_of_birth, due_date_of_birth, age, age_of_youngest`)
- added `variables/entitlements/income_tax/best_start.py` with variables (`income_tax__caregiver_eligible_for_best_start_tax_credit, income_tax__family_has_children_eligible_for_best_start, income_tax__entitlement_for_best_start_tax_credit`)
- added `variables/entitlements/income_tax/family_scheme.py` with variables (`income_tax__qualifies_for_entitlements_under_family_scheme, income_tax__caregiver_age_qualifies_under_family_scheme, income_tax__person_principal_carer_qualifies_under_family_scheme`)
- added `variables/entitlements/income_tax/working_for_families.py` with variables (`social_security__received_income_tested_benefit, veterans_support__received_parents_allowance, veterans_support__received_childrens_pension, income_tax__resident, income_tax__family_has_dependent_children, income_tax__dependent_child`)

# 3.0.0 - [#20](https://github.com/ServiceInnovationLab/openfisca-aotearoa/pull/20)

* Tax and benefit system evolution.
* Tax and benefit system evolution.
* Impacted periods: all.
* Impacted areas:
* Impacted areas:
- Variables `income_tax__tax_payer_filing_status, income_tax__annual_gross_income, income_tax__annual_total_deduction, income_tax__net_income, income_tax__net_loss, income_tax__available_tax_loss, income_tax__taxable_income, rates_rebates__dependants, rates_rebates__rates_total, rates_rebates__combined_income, rates_rebates__rebate, rates_rebates__maximum_income_for_full_rebate, rates_rebates__minimum_income_for_no_rebate`
* Details:
- Variable renaming, impacts the OpenFisca-Aotearoa public API (for instance renaming or removing a variable)
Expand Down
2 changes: 1 addition & 1 deletion Procfile
@@ -1 +1 @@
web: SERVER_NAME=beststart.herokuapp.com openfisca serve --country-package openfisca_aotearoa --port $PORT --bind 0.0.0.0:$PORT
web: SERVER_NAME=openfisca-aotearoa.herokuapp.com openfisca serve --country-package openfisca_aotearoa --port $PORT --bind 0.0.0.0:$PORT
Expand Up @@ -16,7 +16,7 @@ class income_tax__qualifies_for_entitlements_under_family_scheme(Variable):
def formula(persons, period, parameters):
age_qualifies = persons("income_tax__caregiver_age_qualifies_under_family_scheme", period)
principle_carer = persons("income_tax__person_principal_carer_qualifies_under_family_scheme", period)
residence = persons("income_tax__qualifies_for_residence_under_family_scheme", period)
residence = persons("income_tax__residence", period)
return age_qualifies * principle_carer * residence


Expand All @@ -31,15 +31,6 @@ def formula(persons, period, parameters):
return persons("age", period) >= 16 # TODO possibly set this as a parameter if it ever changes


class income_tax__qualifies_for_residence_under_family_scheme(Variable):
value_type = bool
entity = Person
default_value = True # TODO residency is required as defined in the act
definition_period = MONTH
label = u'A person is only eligible under the family scheme if they are a primary carer of 1 or more dependant persons'
reference = "http://legislation.govt.nz/act/public/2007/0097/latest/DLM1518482.html"


class income_tax__person_principal_carer_qualifies_under_family_scheme(Variable):
value_type = bool
entity = Person
Expand All @@ -49,31 +40,3 @@ class income_tax__person_principal_carer_qualifies_under_family_scheme(Variable)

def formula(persons, period, parameters):
return persons.has_role(Family.PRINCIPAL_CAREGIVER) * persons.family("income_tax__family_has_dependent_children", period)


class income_tax__family_has_dependent_children(Variable):
value_type = bool
entity = Family
definition_period = MONTH
label = u'A family has one or more people who qualify as financially dependant children'
reference = "http://legislation.govt.nz/act/public/2007/0097/latest/DLM1518480.html"

def formula(families, period, parameters):
return families.max(families.members("income_tax__dependent_child", period))


class income_tax__dependent_child(Variable):
value_type = bool
entity = Person
definition_period = MONTH
label = u'Determines if a Person is classified as financially dependant'
reference = "http://legislation.govt.nz/act/public/2007/0097/latest/DLM1520575.html#DLM1520883"

def formula(person, period, parameters):
age = person('age', period)
# TODO - It's not this simple, this needs to be tweaked to include the edge criteria above.
# not in a marriage, civil union, or de facto relationship
# is or less than 15
# or 16 and 17 and not finanially independant
# is 18 and many conditions (see act)
return age <= 18
Expand Up @@ -3,7 +3,7 @@
# Import from openfisca-core the common python objects used to code the legislation in OpenFisca
from openfisca_core.model_api import *
# Import the entities specifically defined for this tax and benefit system
from openfisca_aotearoa.entities import Person
from openfisca_aotearoa.entities import Person, Family


class social_security__received_income_tested_benefit(Variable):
Expand All @@ -30,10 +30,11 @@ class veterans_support__received_childrens_pension(Variable):
reference = "http://www.legislation.govt.nz/act/public/2007/0097/latest/whole.html#DLM1518484"


class income_tax__resident(Variable):
class income_tax__residence(Variable):
value_type = bool
entity = Person
definition_period = YEAR
definition_period = MONTH
default_value = True # TODO residency is required as defined in the act
label = u'Boolean for if a Person is classified as meeting residence requirements'
reference = "http://www.legislation.govt.nz/act/public/2007/0097/latest/DLM1518482.html"
# This should really be a forumla based variable covering the full residency criteria.
Expand Down Expand Up @@ -61,3 +62,31 @@ def formula(person, period, parameters):

return not_(received_tested_benefit) * not_(received_parents_allowance) * not_(received_childrens_pension)
# TODO - Add remaining eligibility criteria as per legislation.


class income_tax__family_has_dependent_children(Variable):
value_type = bool
entity = Family
definition_period = MONTH
label = u'A family has one or more people who qualify as financially dependant children'
reference = "http://legislation.govt.nz/act/public/2007/0097/latest/DLM1518480.html"

def formula(families, period, parameters):
return families.max(families.members("income_tax__dependent_child", period))


class income_tax__dependent_child(Variable):
value_type = bool
entity = Person
definition_period = MONTH
label = u'Determines if a Person is classified as financially dependant'
reference = "http://legislation.govt.nz/act/public/2007/0097/latest/DLM1520575.html#DLM1520883"

def formula(person, period, parameters):
age = person('age', period)
# TODO - It's not this simple, this needs to be tweaked to include the edge criteria above.
# not in a marriage, civil union, or de facto relationship
# is or less than 15
# or 16 and 17 and not finanially independant
# is 18 and many conditions (see act)
return age <= 18
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -7,7 +7,7 @@

setup(
name='OpenFisca-Aotearoa',
version='3.0.1',
version='4.0.0',
author='Service Innovation Lab',
author_email='hamish.fraser@dia.govt.nz',
description=u'OpenFisca tax and benefit system for Aotearoa',
Expand Down

0 comments on commit fcd9c78

Please sign in to comment.