Skip to content

Commit

Permalink
Merge pull request #32 from DTS-STN/Updated-dtc-and-cesb-naming
Browse files Browse the repository at this point in the history
Updated dtc and cesb naming
  • Loading branch information
MikeBungay authored Aug 18, 2020
2 parents d38687b + 6a398ce commit 8e89674
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 42 deletions.
40 changes: 20 additions & 20 deletions openfisca_canada/tests/benefitfinder/cesb/cesb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
24 changes: 12 additions & 12 deletions openfisca_canada/tests/benefitfinder/dtc/dtc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
return persons("cesb__is_student_2019_2020", period) + persons("cesb__is_high_school_grad", period)
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

0 comments on commit 8e89674

Please sign in to comment.