Skip to content

Commit

Permalink
Add Peta's case
Browse files Browse the repository at this point in the history
  • Loading branch information
bonjourmauko committed Dec 4, 2022
1 parent 7f47219 commit a8a5c6f
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ section_5:

section_6:
description: >
o any other person whose accommodation costs are the sum of payments
To any other person whose accommodation costs are the sum of payments
required under any mortgage security, and other payments that the chief
executive is satisfied are reasonably required to be made in respect of
the person’s home.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
- name: >
BenefitMe
Peta's Story
period: 2022-12-05
relative_error_margin: 0.001
input:
persons:
Peta:
age:
day:2022-01-01:365: 32
social_security__in_a_relationship:
week:2022-W01:52: false
accommodation_costs:
week:2022-W01:52: 350
accommodation_type:
week:2022-W01:52: rent
accommodation_supplement__area_of_residence:
week:2022-W01:52: area_2
family_tax_credit__eligible:
2022: true
jobseeker_support__entitled:
week:2022-W01:52: true
Anahera:
age:
day:2022-01-01:365: 5
social_security__dependent_child:
week:2022-W01:52: true
family_tax_credit__dependent_child:
2022: true
family:
principal: Peta
children: [Anahera]
output:
accommodation_supplement:
2022-W49: [145.54, 0]
family_tax_credit:
2022: [6623.80, 0]
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
2022-W02: true
2022-W03: false
family_tax_credit__dependent_child:
2022: 33
2022: .33
Srko:
date_of_birth:
ETERNITY: 2006-01-11
Expand All @@ -59,7 +59,7 @@
2022-W02: true
2022-W03: false
family_tax_credit__dependent_child:
2022: 33
2022: .33
Ash:
date_of_birth:
ETERNITY: 2006-01-12
Expand All @@ -68,7 +68,7 @@
2022-W02: true
2022-W03: true
family_tax_credit__dependent_child:
2022: 33
2022: .33
family:
principal: Vranda
children: [Piedad, Srko, Ash]
Expand Down Expand Up @@ -154,7 +154,7 @@
2022-W02: true
2022-W03: false
family_tax_credit__dependent_child:
2022: 33
2022: .33
Srko:
date_of_birth:
ETERNITY: 2006-01-11
Expand All @@ -163,7 +163,7 @@
2022-W02: true
2022-W03: false
family_tax_credit__dependent_child:
2022: 33
2022: .33
Ash:
date_of_birth:
ETERNITY: 2006-01-12
Expand All @@ -172,7 +172,7 @@
2022-W02: true
2022-W03: true
family_tax_credit__dependent_child:
2022: 33
2022: .33
family:
principal: Vranda
children: [Piedad, Srko, Ash]
Expand Down Expand Up @@ -214,7 +214,7 @@
2022-W02: true
2022-W03: false
family_tax_credit__dependent_child:
2022: 33
2022: .33
Srko:
date_of_birth:
ETERNITY: 2006-01-11
Expand All @@ -223,7 +223,7 @@
2022-W02: true
2022-W03: false
family_tax_credit__dependent_child:
2022: 33
2022: .33
Ash:
date_of_birth:
ETERNITY: 2006-01-12
Expand All @@ -232,7 +232,7 @@
2022-W02: true
2022-W03: true
family_tax_credit__dependent_child:
2022: 33
2022: .33
family:
principal: Vranda
children: [Piedad, Srko, Ash]
Expand Down Expand Up @@ -314,7 +314,7 @@
2022-W02: true
2022-W03: false
family_tax_credit__dependent_child:
2022: 33
2022: .33
Srko:
date_of_birth:
ETERNITY: 2006-01-11
Expand All @@ -323,7 +323,7 @@
2022-W02: true
2022-W03: false
family_tax_credit__dependent_child:
2022: 33
2022: .33
Ash:
date_of_birth:
ETERNITY: 2006-01-12
Expand All @@ -332,7 +332,7 @@
2022-W02: true
2022-W03: true
family_tax_credit__dependent_child:
2022: 33
2022: .33
family:
principal: Vranda
children: [Piedad, Srko, Ash]
Expand Down Expand Up @@ -394,7 +394,7 @@
2022-W02: true
2022-W03: false
family_tax_credit__dependent_child:
2022: 33
2022: .33
Srko:
date_of_birth:
ETERNITY: 2006-01-11
Expand All @@ -403,7 +403,7 @@
2022-W02: true
2022-W03: false
family_tax_credit__dependent_child:
2022: 33
2022: .33
Ash:
date_of_birth:
ETERNITY: 2006-01-12
Expand All @@ -412,7 +412,7 @@
2022-W02: true
2022-W03: true
family_tax_credit__dependent_child:
2022: 33
2022: .33
family:
principal: Vranda
partners: [Bob]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy
import pandas

from openfisca_core import indexed_enums, periods, variables
from openfisca_core import holders, indexed_enums, periods, variables

from openfisca_aotearoa import entities

Expand Down Expand Up @@ -37,6 +37,7 @@ class accommodation_supplement__area_of_residence(variables.Variable):
possible_values = AccommodationSupplement__AreaOfResidence
default_value = AccommodationSupplement__AreaOfResidence.unknown
definition_period = periods.DateUnit.WEEK
set_input = holders.set_input_dispatch_by_period

def formula_2018_11_26(people, period, _params):
area_of_residence = AccommodationSupplement__AreaOfResidence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class jobseeker_support__entitled(variables.Variable):
definition_period = periods.WEEK
label = "Jobseeker Support eligibility and amount"
reference = "https://www.legislation.govt.nz/act/public/2018/0032/latest/whole.html#DLM6783144", "http://legislation.govt.nz/act/public/1964/0136/latest/DLM5478527.html"
set_input = holders.set_input_dispatch_by_period

# Old Job Seeker formula for 1964 Act, rewritten to show gaps
def formula_2013_04_17(persons, period, parameters):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# For more information on OpenFisca's available modules:
# https://openfisca.org/doc/openfisca-python-api/index.html
from openfisca_core import periods, variables
from openfisca_core import holders, periods, variables

# We import the required `entities` corresponding to our formulas.
#
Expand All @@ -24,6 +24,7 @@ class sole_parent_support__benefit(variables.Variable):
definition_period = periods.WEEK
label = "The final net benefit entitlement"
reference = "https://www.legislation.govt.nz/act/public/2018/0032/latest/DLM6784854.html"
set_input = holders.set_input_dispatch_by_period

def formula_2018_11_26(people, period, parameters):
return people("sole_parent_support__entitled", period) * numpy.clip(people("sole_parent_support__base", period) - people("sole_parent_support__reduction", period), 0, people("sole_parent_support__base", period))
Expand Down
4 changes: 3 additions & 1 deletion openfisca_aotearoa/variables/demographics/housing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""TODO: Add missing doctring."""

from openfisca_core import indexed_enums, periods, variables
from openfisca_core import holders, indexed_enums, periods, variables

from openfisca_aotearoa import entities

Expand All @@ -24,6 +24,7 @@ class accommodation_type(variables.Variable):
possible_values = AccommodationType
default_value = AccommodationType.unknown
definition_period = periods.DateUnit.WEEK
set_input = holders.set_input_dispatch_by_period


class accommodation_costs(variables.Variable):
Expand All @@ -34,3 +35,4 @@ class accommodation_costs(variables.Variable):
value_type = float
default_value = 0
definition_period = periods.DateUnit.WEEK
set_input = holders.set_input_dispatch_by_period

0 comments on commit a8a5c6f

Please sign in to comment.