Skip to content

Commit

Permalink
Resolves multiple warnings when running test suites, apparently requi…
Browse files Browse the repository at this point in the history
…red values not supplied result in warnings
  • Loading branch information
verbman committed Dec 2, 2023
1 parent d34100b commit b271c89
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
2022-W49: rent
accommodation_supplement__area_of_residence:
2022-W49: area_2
student_allowance__person_has_spouse:
2022-12: false
output:
jobseeker_support__benefit:
2022-W49: 440.96
Expand Down Expand Up @@ -59,6 +61,8 @@
2022-W49: rent
accommodation_supplement__area_of_residence:
2022-W49: area_2
student_allowance__person_has_spouse:
2022-12: false
Anahera:
family_tax_credit__dependent_child:
2022: .5
Expand Down Expand Up @@ -89,6 +93,8 @@
week:2022-W01:52: area_2
accommodation_supplement__cash_assets:
2022-W49: 800
student_allowance__person_has_spouse:
2022-12: false
output:
jobseeker_support__benefit:
2022-W49: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
2024-W01: [8100, 8100, 8100, 8100, 8101, 8100]
age:
day:2022-01-03:7: [24, 24, 24, 24, 24, 24]
day:2022-01-11:7: [24, 24, 24, 24, 24, 24]
day:2023-01-01:7: [24, 24, 24, 24, 24, 24]
day:2022-01-10:7: [24, 24, 24, 24, 24, 24]
day:2023-01-02:7: [24, 24, 24, 24, 24, 24]
day:2024-01-01:7: [24, 24, 24, 24, 24, 24]
jobseeker_support__receiving:
2022-W01: [true, true, true, true, true, true]
Expand All @@ -39,6 +39,10 @@
2022-W02: [Alexandra urban area, Alexandra urban area, Alexandra urban area, Arrowtown urban area, Arrowtown urban area, Arrowtown urban area]
2023-W01: [Alexandra urban area, Alexandra urban area, Alexandra urban area, Arrowtown urban area, Arrowtown urban area, Arrowtown urban area]
2024-W01: [Alexandra urban area, Alexandra urban area, Alexandra urban area, Arrowtown urban area, Arrowtown urban area, Arrowtown urban area]
basic_grant__entitled:
2022-01: [false, false, false, false, false, false]
2023-01: [false, false, false, false, false, false]
2024-01: [false, false, false, false, false, false]
output:
accommodation_supplement:
2022-W01: [0.00, 21.26, 56.26, 91.26, 0.00, 165.00] # January
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
input:
basic_grant__receiving:
2022-W01: [true, true, false, false]
basic_grant__entitled:
2022-01: [true, true, false, false]
independent_circumstances_grant__receiving:
2022-W01: [true, false, true, false]
output:
Expand Down Expand Up @@ -79,6 +81,8 @@
input:
basic_grant__would_be_entitled:
2022-W01: [true, true, false, false]
basic_grant__entitled:
2022-01: [true, true, false, false]
independent_circumstances_grant__would_be_entitled:
2022-W01: [true, false, true, false]
output:
Expand All @@ -95,6 +99,8 @@
input:
accommodation_type:
2022-W01: [residential_care, under_the_moon]
basic_grant__entitled:
2022-01: [false, false]
output:
accommodation_supplement__other_funding_exclusion:
2022-W01: [true, false]
Expand All @@ -109,6 +115,8 @@
input:
accommodation_supplement__disability:
2022-W01: [true, false]
basic_grant__entitled:
2022-01: [false, false]
output:
accommodation_supplement__other_funding_exclusion:
2022-W01: [true, false]
35 changes: 19 additions & 16 deletions openfisca_aotearoa/tests/student_allowance/basic_grant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,41 @@
persons:
fulltime_uni_student:
age:
"2017-08-01": 21
day:2017-08-01:31: 21
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__tertiary_student: true
student_allowance__enrolled_fulltime: true
student_allowance__meets_attendance_and_performance_requirements: true
student_allowance__married_or_partnered: false

Parttime_student:
age:
"2017-08-01": 18
day:2017-08-01:31: 18
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__tertiary_student: true
student_allowance__approved_to_study_parttime: true

Overseas_student:
age:
"2017-08-01": 27
day:2017-08-01:31: 27
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__tertiary_student: true
student_allowance__approved_to_study_overseas: true

Refugee:
age:
"2017-08-01": 25
day:2017-08-01:31: 25
immigration__recognised_refugee: true
student_allowance__tertiary_student: true
student_allowance__enrolled_fulltime: true
student_allowance__meets_attendance_and_performance_requirements: true

Not_a_student:
age:
"2017-08-01": 50
day:2017-08-01:31: 50
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__tertiary_student: false
Expand All @@ -57,7 +58,7 @@
persons:
married_secondary_school_student_with_child:
age:
"2017-08-01": 16
day:2017-08-01:31: 16
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__secondary_student: true
Expand All @@ -69,7 +70,7 @@

not_married_secondary_school_student_with_child:
age:
"2017-08-01": 16
day:2017-08-01:31: 16
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__secondary_student: true
Expand All @@ -80,7 +81,7 @@

childless_married_secondary_school_student:
age:
"2017-08-01": 16
day:2017-08-01:31: 16
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__secondary_student: true
Expand All @@ -91,7 +92,7 @@

18yo_secondary_student:
age:
"2017-08-01": 18
day:2017-08-01:31: 18
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__secondary_student: true
Expand All @@ -110,11 +111,12 @@
persons:
default:
age:
"2017-08-01": 22
day:2017-08-01:31: 22
student_allowance__married_or_partnered: false

not_attending:
age:
"2017-08-01": 21
day:2017-08-01:31: 21
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__tertiary_student: true
Expand All @@ -123,7 +125,7 @@

not_immigration__citizen_or_resident:
age:
"2017-08-01": 21
day:2017-08-01:31: 21
student_allowance__tertiary_student: true
student_allowance__enrolled_fulltime: true
student_allowance__meets_attendance_and_performance_requirements: true
Expand All @@ -140,32 +142,33 @@
persons:
fulltime_uni_studdent:
age:
"2017-08-01": 67
day:2017-08-01:31: 67
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__tertiary_student: true
student_allowance__enrolled_fulltime: true
student_allowance__meets_attendance_and_performance_requirements: true
student_allowance__married_or_partnered: false

Parttime_student:
age:
"2017-08-01": 68
day:2017-08-01:31: 68
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__tertiary_student: true
student_allowance__approved_to_study_parttime: true

Overseas_student:
age:
"2017-08-01": 70
day:2017-08-01:31: 70
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__tertiary_student: true
student_allowance__approved_to_study_overseas: true

Refugee:
age:
"2017-08-01": 99
day:2017-08-01:31: 99
immigration__recognised_refugee: true
student_allowance__tertiary_student: true
student_allowance__enrolled_fulltime: true
Expand Down
2 changes: 2 additions & 0 deletions openfisca_aotearoa/variables/demographics/ages.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Import from openfisca-core the common python objects used to code the legislation in OpenFisca
from openfisca_core.periods import DAY, ETERNITY
from openfisca_core.variables import Variable
from openfisca_core.holders import set_input_dispatch_by_period

# Import the entities specifically defined for this tax and benefit system
from openfisca_aotearoa.entities import Family, Person
Expand Down Expand Up @@ -70,6 +71,7 @@ class age_of_partner(Variable):
definition_period = DAY
unit = "years"
label = "The maximum age of partner in a family"
set_input = set_input_dispatch_by_period

def formula(persons, period, parameters):
return persons.family.max(persons.family.members("age", period), role=Family.PARTNER)

0 comments on commit b271c89

Please sign in to comment.