From 02d47f9525ddb37905f01400f6f5f390958b56fe Mon Sep 17 00:00:00 2001 From: Thomas Dacey Date: Tue, 18 Aug 2020 08:48:23 -0400 Subject: [PATCH 1/2] DTC has document renamed for clarity --- .../tests/benefitfinder/dtc/dtc.yaml | 24 +++++++++---------- .../benefitfinder/dtc/dtc__document.py | 2 +- .../benefitfinder/dtc/dtc__is_eligible.py | 8 +++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/openfisca_canada/tests/benefitfinder/dtc/dtc.yaml b/openfisca_canada/tests/benefitfinder/dtc/dtc.yaml index 0edb8af2..3e32fc9e 100644 --- a/openfisca_canada/tests/benefitfinder/dtc/dtc.yaml +++ b/openfisca_canada/tests/benefitfinder/dtc/dtc.yaml @@ -4,9 +4,9 @@ input: persons: parent: - dtc__has_document: true + dtc__has_documented_disability: true child: - dtc__has_document: true + dtc__has_documented_disability: true families: f1: children: ["child"] @@ -22,9 +22,9 @@ input: persons: parent: - dtc__has_document: false + dtc__has_documented_disability: false child: - dtc__has_document: true + dtc__has_documented_disability: true families: f1: children: ["child"] @@ -40,9 +40,9 @@ input: persons: parent: - dtc__has_document: true + dtc__has_documented_disability: true child: - dtc__has_document: false + dtc__has_documented_disability: false families: f1: children: ["child"] @@ -58,9 +58,9 @@ input: persons: parent: - dtc__has_document: false + dtc__has_documented_disability: false child: - dtc__has_document: false + dtc__has_documented_disability: false families: f1: children: ["child"] @@ -76,7 +76,7 @@ input: persons: has_document_has_oas: - dtc__has_document: true + dtc__has_documented_disability: true oas__is_eligible: true output: dtc__is_eligible: true @@ -88,7 +88,7 @@ input: persons: has_no_document_has_oas: - dtc__has_document: false + dtc__has_documented_disability: false oas__is_eligible: true output: dtc__is_eligible: false @@ -100,7 +100,7 @@ input: persons: has_document_has_no_oas: - dtc__has_document: true + dtc__has_documented_disability: true oas__is_eligible: false output: dtc__is_eligible: true @@ -112,7 +112,7 @@ input: persons: has_no_document_has_no_oas: - dtc__has_document: false + dtc__has_documented_disability: false oas__is_eligible: false output: dtc__is_eligible: false diff --git a/openfisca_canada/variables/benefitfinder/dtc/dtc__document.py b/openfisca_canada/variables/benefitfinder/dtc/dtc__document.py index a431a2a5..f648ee18 100644 --- a/openfisca_canada/variables/benefitfinder/dtc/dtc__document.py +++ b/openfisca_canada/variables/benefitfinder/dtc/dtc__document.py @@ -4,7 +4,7 @@ from openfisca_canada.entities import Person, Family -class dtc__has_document(Variable): +class dtc__has_documented_disability(Variable): value_type = bool entity = Person definition_period = MONTH diff --git a/openfisca_canada/variables/benefitfinder/dtc/dtc__is_eligible.py b/openfisca_canada/variables/benefitfinder/dtc/dtc__is_eligible.py index 70b887f4..669801c8 100644 --- a/openfisca_canada/variables/benefitfinder/dtc/dtc__is_eligible.py +++ b/openfisca_canada/variables/benefitfinder/dtc/dtc__is_eligible.py @@ -13,10 +13,10 @@ class dtc__is_eligible(Variable): def formula(persons, period, parameters): #if persons.family.nb_persons(role=Family.CHILD).any(): if persons.has_role(Family.PARENT).any(): - return persons('dtc__has_document', period) +\ - persons.family.any(persons.family.members('dtc__has_document', period), role=Family.CHILD) + return persons('dtc__has_documented_disability', period) +\ + persons.family.any(persons.family.members('dtc__has_documented_disability', period), role=Family.CHILD) else: - return persons('dtc__has_document', period) + return persons('dtc__has_documented_disability', period) class dtc__is_eligible_for_dtc_and_oas(Variable): value_type = bool @@ -25,5 +25,5 @@ class dtc__is_eligible_for_dtc_and_oas(Variable): label = u"Is person eligible for a disibility tax credit and old age security" def formula(persons, period, parameters): - return persons('dtc__has_document', period) *\ + return persons('dtc__has_documented_disability', period) *\ persons('oas__is_eligible', period) \ No newline at end of file From 6a398ce41937e4f6011e3124bbbf2716abe4caf9 Mon Sep 17 00:00:00 2001 From: Thomas Dacey Date: Tue, 18 Aug 2020 08:49:07 -0400 Subject: [PATCH 2/2] CESB qualifiers are now more esplicit --- .../tests/benefitfinder/cesb/cesb.yaml | 40 +++++++++---------- .../benefitfinder/cesb/cesb__is_eligible.py | 2 +- .../benefitfinder/cesb/student_status.py | 8 ++-- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/openfisca_canada/tests/benefitfinder/cesb/cesb.yaml b/openfisca_canada/tests/benefitfinder/cesb/cesb.yaml index d4ff8950..578e2358 100644 --- a/openfisca_canada/tests/benefitfinder/cesb/cesb.yaml +++ b/openfisca_canada/tests/benefitfinder/cesb/cesb.yaml @@ -4,19 +4,19 @@ absolute_error_margin: 0 input: persons: student_1: - student_lost_job: true - has_no_income_before: false + cesb__student_lost_job: true + cesb__has_no_income_before: false student_2: - student_lost_job: false - has_no_income_before: true + cesb__student_lost_job: false + cesb__has_no_income_before: true student_3: - student_lost_job: false - has_no_income_before: false + cesb__student_lost_job: false + cesb__has_no_income_before: false student_4: - student_lost_job: true - has_no_income_before: true + cesb__student_lost_job: true + cesb__has_no_income_before: true output: - is_student_2019_2020: + cesb__is_student_2019_2020: - true - true - false @@ -28,11 +28,11 @@ absolute_error_margin: 0 input: persons: student_1: - has_no_income_before: false + cesb__has_no_income_before: false student_2: - has_no_income_before: true + cesb__has_no_income_before: true output: - is_high_school_grad: + cesb__is_high_school_grad: - false - true @@ -42,17 +42,17 @@ absolute_error_margin: 0 input: persons: student_1: - is_student_2019_2020: true - is_high_school_grad: false + cesb__is_student_2019_2020: true + cesb__is_high_school_grad: false student_2: - is_student_2019_2020: true - is_high_school_grad: false + cesb__is_student_2019_2020: true + cesb__is_high_school_grad: false student_3: - is_student_2019_2020: true - is_high_school_grad: true + cesb__is_student_2019_2020: true + cesb__is_high_school_grad: true student_4: - is_student_2019_2020: false - is_high_school_grad: false + cesb__is_student_2019_2020: false + cesb__is_high_school_grad: false output: cesb__is_eligible: - true diff --git a/openfisca_canada/variables/benefitfinder/cesb/cesb__is_eligible.py b/openfisca_canada/variables/benefitfinder/cesb/cesb__is_eligible.py index 14ff31b1..19561ca0 100644 --- a/openfisca_canada/variables/benefitfinder/cesb/cesb__is_eligible.py +++ b/openfisca_canada/variables/benefitfinder/cesb/cesb__is_eligible.py @@ -10,4 +10,4 @@ class cesb__is_eligible(Variable): label = u"student is eligible for CESB benefit" def formula(persons, period, parameters): - return persons("is_student_2019_2020", period) + persons("is_high_school_grad", period) \ No newline at end of file + return persons("cesb__is_student_2019_2020", period) + persons("cesb__is_high_school_grad", period) \ No newline at end of file diff --git a/openfisca_canada/variables/benefitfinder/cesb/student_status.py b/openfisca_canada/variables/benefitfinder/cesb/student_status.py index 99359ad9..c1443db0 100644 --- a/openfisca_canada/variables/benefitfinder/cesb/student_status.py +++ b/openfisca_canada/variables/benefitfinder/cesb/student_status.py @@ -3,7 +3,7 @@ # Import the entities specifically defined for this tax and benefit system from openfisca_canada.entities import Person -class is_student_2019_2020(Variable): +class cesb__is_student_2019_2020(Variable): value_type = bool entity = Person label = u"Is student in the year of 2019-2020" @@ -12,7 +12,7 @@ class is_student_2019_2020(Variable): def formula(persons, period, parameters): return persons("student_lost_job", period) + persons("has_no_income_before", period) -class is_high_school_grad(Variable): +class cesb__is_high_school_grad(Variable): value_type = bool entity = Person definition_period = MONTH @@ -21,13 +21,13 @@ class is_high_school_grad(Variable): def formula(persons, period, parameters): return persons("has_no_income_before", period) -class student_lost_job(Variable): +class cesb__student_lost_job(Variable): value_type = bool entity = Person definition_period = MONTH label = u"student lost job" -class has_no_income_before(Variable): +class cesb__has_no_income_before(Variable): value_type = bool entity = Person definition_period = MONTH