Skip to content

Commit

Permalink
Fixes warnings and linting issues related to the accomodation supplement
Browse files Browse the repository at this point in the history
  • Loading branch information
verbman committed Mar 12, 2024
1 parent c28ff7b commit f2ac7ea
Show file tree
Hide file tree
Showing 18 changed files with 172 additions and 104 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

### 21.0.1 - [61](https://github.com/digitalaotearoa/openfisca-aotearoa/pull/61)

* Tax and benefit system evolution.
* Impacted periods: all.
* Impacted areas:
- `variables/acts/social_security`
- `variables/acts/income_tax`
- `variables/regulation/student_allowance`
- `variables/regulation/social_security`
- `variables/demographics`
* Details:
- Resolve warnings present in Accomodation Supplement Tests
- Resolved linting issues

* Breaking changes:
- `student_allowance__married_or_partnered` period changed from month to day
- `student_allowance__supported_child` period changed from month to day
- `student_allowance__partner_has_a_supported_child` period changed from month to day
- `student_allowance__person_has_spouse` period changed from month to day, formula updated

* Changes:
- `age_of_partner` set_input_dispatch_by_period applied

### 21.0.0 - [60](https://github.com/digitalaotearoa/openfisca-aotearoa/pull/60)

* Tax and benefit system evolution.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
Peta:
age:
day:2022-01-01:365: 32
age_of_partner:
day:2022-01-01:365: 32
social_security__residential_requirement:
2022-W49: true
social_security__in_a_relationship:
Expand Down Expand Up @@ -43,6 +45,8 @@
Peta:
age:
day:2022-01-01:365: 32
age_of_partner:
day:2022-01-01:365: 32
social_security__residential_requirement:
2022-W49: true
social_security__in_a_relationship:
Expand Down Expand Up @@ -81,6 +85,8 @@
Kai:
age:
day:2022-01-01:365: 23
age_of_partner:
day:2022-01-01:365: 32
accommodation_costs:
week:2022-W01:52: 350
accommodation_type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
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]
age_of_partner:
day:2022-01-01:31: [24, 24, 24, 24, 24, 24]
day:2023-01-01:31: [24, 24, 24, 24, 24, 24]
day:2024-01-01:31: [24, 24, 24, 24, 24, 24]
jobseeker_support__receiving:
2022-W01: [true, true, true, true, true, true]
2022-W02: [true, true, true, true, true, true]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
input:
accommodation_type:
2022-W01: [social_housing, under_the_sun]
age_of_partner:
day:2022-01-01:31: [ 24, 24 ]
output:
accommodation_supplement__social_housing_exclusion:
2022-W01: [true, false]
Expand All @@ -25,6 +27,8 @@
accommodation_supplement__receiving:
2022-W01: true
2022-W02: false
age:
day:2022-01-01:31: 24
family:
principal: Vrenda
partners: [Piedad]
Expand All @@ -46,6 +50,8 @@
2022-W01: [true, true, false, false]
independent_circumstances_grant__receiving:
2022-W01: [true, false, true, false]
age_of_partner:
day:2022-01-01:31: [ 24, 24, 24, 24 ]

Check warning on line 54 in openfisca_aotearoa/tests/social_security/accommodation_supplement/2018/exclusion.yaml

View workflow job for this annotation

GitHub Actions / lint

54:36 [commas] too many spaces after comma
output:
accommodation_supplement__other_funding_exclusion:
2022-W01: [true, true, true, false]
Expand All @@ -63,6 +69,8 @@
2022-01: [true, true, false, false]
independent_circumstances_grant__entitled:
2022-01: [true, false, true, false]
age_of_partner:
day:2022-01-01:31: [ 24, 24, 24, 24 ]

Check warning on line 73 in openfisca_aotearoa/tests/social_security/accommodation_supplement/2018/exclusion.yaml

View workflow job for this annotation

GitHub Actions / lint

73:36 [commas] too many spaces after comma
output:
accommodation_supplement__other_funding_exclusion:
2022-W01: [true, true, true, false]
Expand All @@ -80,6 +88,8 @@
2022-W01: [true, true, false, false]
independent_circumstances_grant__would_be_entitled:
2022-W01: [true, false, true, false]
age_of_partner:
day:2022-01-01:31: [ 24, 24 , 24, 24 ]

Check warning on line 92 in openfisca_aotearoa/tests/social_security/accommodation_supplement/2018/exclusion.yaml

View workflow job for this annotation

GitHub Actions / lint

92:34 [commas] too many spaces before comma
output:
accommodation_supplement__other_funding_exclusion:
2022-W01: [true, true, true, false]
Expand All @@ -94,6 +104,8 @@
input:
accommodation_type:
2022-W01: [residential_care, under_the_moon]
age_of_partner:
day:2022-01-01:31: [ 24, 24 ]
output:
accommodation_supplement__other_funding_exclusion:
2022-W01: [true, false]
Expand All @@ -108,6 +120,8 @@
input:
accommodation_supplement__disability:
2022-W01: [true, false]
age_of_partner:
day:2022-01-01:31: [ 24, 24 ]
output:
accommodation_supplement__other_funding_exclusion:
2022-W01: [true, false]
82 changes: 60 additions & 22 deletions openfisca_aotearoa/tests/student_allowance/basic_grant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
persons:
fulltime_uni_student:
age:
"2017-08-01": 21
"day:2017-08-01:31": 21
age_of_partner:
"day:2017-08-01:31": 25
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__tertiary_student: true
Expand All @@ -15,31 +17,39 @@

Parttime_student:
age:
"2017-08-01": 18
"day:2017-08-01:31": 18
age_of_partner:
"day:2017-08-01:31": 25
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
age_of_partner:
"day:2017-08-01:31": 25
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
age_of_partner:
"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
age_of_partner:
"day:2017-08-01:31": 25
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__tertiary_student: false
Expand All @@ -57,41 +67,55 @@
persons:
married_secondary_school_student_with_child:
age:
"2017-08-01": 16
"day:2017-08-01:31": 16
age_of_partner:
"day:2017-08-01:31": 20
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__secondary_student: true
student_allowance__married_or_partnered: true
student_allowance__supported_child: true
student_allowance__married_or_partnered:
"day:2017-08-01:31": true
student_allowance__supported_child:
"day:2017-08-01:31": true
student_allowance__enrolled_fulltime: true
student_allowance__meets_attendance_and_performance_requirements: true


not_married_secondary_school_student_with_child:
age:
"2017-08-01": 16
"day:2017-08-01:31": 16
age_of_partner:
"day:2017-08-01:31": 20
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__secondary_student: true
student_allowance__married_or_partnered: false
student_allowance__supported_child: true
student_allowance__married_or_partnered:
"day:2017-08-01:31": false
student_allowance__supported_child:
"day:2017-08-01:31": true
student_allowance__enrolled_fulltime: true
student_allowance__meets_attendance_and_performance_requirements: true

childless_married_secondary_school_student:
age:
"2017-08-01": 16
"day:2017-08-01:31": 16
age_of_partner:
"day:2017-08-01:31": 20
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__secondary_student: true
student_allowance__married_or_partnered: false
student_allowance__supported_child: false
student_allowance__married_or_partnered:
"day:2017-08-01:31": false
student_allowance__supported_child:
"day:2017-08-01:31": false
student_allowance__enrolled_fulltime: true
student_allowance__meets_attendance_and_performance_requirements: true

18yo_secondary_student:
age:
"2017-08-01": 18
"day:2017-08-01:31": 18
age_of_partner:
"day:2017-08-01:31": 20
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__secondary_student: true
Expand All @@ -110,11 +134,15 @@
persons:
default:
age:
"2017-08-01": 22
"day:2017-08-01:31": 22
age_of_partner:
"day:2017-08-01:31": 20

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

not_immigration__citizen_or_resident:
age:
"2017-08-01": 21
"day:2017-08-01:31": 21
age_of_partner:
"day:2017-08-01:31": 20
student_allowance__tertiary_student: true
student_allowance__enrolled_fulltime: true
student_allowance__meets_attendance_and_performance_requirements: true
Expand All @@ -140,7 +170,9 @@
persons:
fulltime_uni_studdent:
age:
"2017-08-01": 67
"day:2017-08-01:31": 67
age_of_partner:
"day:2017-08-01:31": 20
citizenship__citizen: true
social_security__ordinarily_resident_in_new_zealand: true
student_allowance__tertiary_student: true
Expand All @@ -149,23 +181,29 @@

Parttime_student:
age:
"2017-08-01": 68
"day:2017-08-01:31": 68
age_of_partner:
"day:2017-08-01:31": 20
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
age_of_partner:
"day:2017-08-01:31": 20
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
age_of_partner:
"day:2017-08-01:31": 20
immigration__recognised_refugee: true
student_allowance__tertiary_student: true
student_allowance__enrolled_fulltime: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class family_tax_credit(Variable):

def formula_2007_11_01(people, period, _params):
return (
+ people("family_tax_credit__eligible", period)
people("family_tax_credit__eligible", period)
* people("family_tax_credit__base", period)
)

Expand All @@ -43,7 +43,7 @@ class family_tax_credit__base(Variable):

def formula_2007_11_01(people, period, _params):
return (
+ people("family_tax_credit__eldest", period, "add")
people("family_tax_credit__eldest", period, "add")
+ people("family_tax_credit__not_eldest", period, "add")
)

Expand Down Expand Up @@ -75,7 +75,7 @@ def formula_2007_11_01(people, period, params):
)

return (
+ principal
principal
* eldest_child
* prescribed_amount
/ period.this_year.days
Expand Down Expand Up @@ -109,7 +109,7 @@ def formula_2007_11_01(people, period, params):
)

return (
+ principal
principal
* other_than_the_eldest_child
* prescribed_amount
/ period.this_year.days
Expand Down
Loading

0 comments on commit f2ac7ea

Please sign in to comment.