6
6
from openfisca_aotearoa .entities import Titled_Property , Person
7
7
from numpy import clip
8
8
9
- #All variables are according to the reference link http://www.legislation.govt.nz/act/public/2006/0040/latest/DLM379487.html#DLM379487
9
+ # All variables are according to the reference link http://www.legislation.govt.nz/act/public/2006/0040/latest/DLM379487.html#DLM379487
10
+
10
11
11
12
class ks_duration (Variable ):
12
13
value_type = int
13
14
entity = Person
14
15
definition_period = MONTH
15
16
label = u"Years the prospective home buyer has been a member of a kiwisaver account"
16
17
18
+
17
19
class contrib_duration__kiwisaver (Variable ):
18
20
value_type = int
19
21
entity = Person
20
22
definition_period = MONTH
21
23
label = u"Years the prospective home buyer has been contributing continuously to their kiwisaver account"
22
24
25
+
23
26
class contrib_duration__kiwisaver (Variable ):
24
27
value_type = bool
25
28
entity = Person
@@ -29,15 +32,17 @@ class contrib_duration__kiwisaver(Variable):
29
32
def formula (persons , period ):
30
33
return persons ('ks_contrib_duration' , period ) >= 3
31
34
35
+
32
36
class homestart_grant__kiwisaver (Variable ):
33
37
value_type = float
34
38
entity = Person
35
39
definition_period = MONTH
36
40
label = u"Amount available to you from the Homestart grant"
37
41
38
42
def formula (persons , period ):
39
- HS_grant = persons ('ks_contrib_duration' , period ) * persons ('ks_contrib_duration_satisfied' , period ) * 1000
40
- return clip (HS_grant ,0 ,5000 )
43
+ HS_grant = persons ('ks_contrib_duration' , period ) * \
44
+ persons ('ks_contrib_duration_satisfied' , period ) * 1000
45
+ return clip (HS_grant , 0 , 5000 )
41
46
42
47
43
48
class purc_price (Variable ):
@@ -110,7 +115,7 @@ class homestart_deposit_eligible(Variable):
110
115
111
116
def formula (persons , period ):
112
117
return persons ('total_savings__kiwisaver' , period ) >= persons ('homestart_deposit_req__kiwisaver' , period )
113
-
118
+
114
119
115
120
class lvr_deposit_eligible (Variable ):
116
121
value_type = float
@@ -129,10 +134,12 @@ class indv_income_per_hs_grant(Variable):
129
134
set_input = set_input_divide_by_period
130
135
# Check how to set input by user and check against the threshold
131
136
137
+
132
138
class combined_income_per_hs_grant (Variable ):
133
139
value_type = int
134
140
entity = Person
135
141
definition_period = YEAR
136
- set_input = set_input_divide_by_period # Allows user to declare a salary for a year.
142
+ # Allows user to declare a salary for a year.
143
+ set_input = set_input_divide_by_period
137
144
# Check how to set input by user and check against the threshold
138
145
label = "Combined income"
0 commit comments