-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add Home Grant and Kiwisaver #17
Open
MattiSG
wants to merge
23
commits into
master
Choose a base branch
from
kiwisaver
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
db62b68
add citizenship variable
d0dd21e
added kiwisaver.py and 3 variables
JudyPuff 3ec3a4b
added 2 yaml files under parameters
JudyPuff f868d33
added prop_threshold yamls and more classes in kiwisaver variable
JudyPuff 0841171
added formula for hs_grant calculation based on years of contribution
JudyPuff 4b74409
added kiwisaver parameters and variables with Hamish
JudyPuff 7d68fb9
Merge branch 'master' into kiwisaver
Br3nda 596b574
Pep8 fixes
Br3nda adedacf
Removed unused import
Br3nda 9d07eac
Renamed class - meets contrib duration requirement
Br3nda 73e130a
Rename variales in test to have __kiwisaver
Br3nda 740b954
Matching test variables to the python
Br3nda cb8c06f
Fixing more variable names
Br3nda f918a83
Rename purc_price to purchase_price
Br3nda 428eaae
Merge branch 'master' into kiwisaver
Br3nda 3d89969
Merge remote-tracking branch 'origin/master' into kiwisaver
Br3nda cf586c0
Clearer variable name
Br3nda 4cb79f9
Merge branch 'kiwisaver' of github.com:ServiceInnovationLab/openfisca…
Br3nda eeb0fac
Merge branch 'bw/kiwisaver' into kiwisaver
Br3nda 7ba8673
refactor - rename variable to have kiwisaver at start
Br3nda ca65513
More variable consistency
Br3nda bdf9a61
Merge branch 'master' into kiwisaver
Br3nda b0816f9
Merge branch 'master' into kiwisaver
Br3nda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
openfisca_aotearoa/parameters/kiwisaver/homestart/ks_duration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,13 @@ class ks_duration(Variable): | |
definition_period = MONTH | ||
label = u"Years the prospective home buyer has been a member of a kiwisaver account" | ||
|
||
class ks_contrib_duration(Variable): | ||
class contrib_duration__kiwisaver(Variable): | ||
value_type = int | ||
entity = Person | ||
definition_period = MONTH | ||
label = u"Years the prospective home buyer has been contributing continuously to their kiwisaver account" | ||
|
||
class ks_contrib_duration_satisfied(Variable): | ||
class contrib_duration__kiwisaver(Variable): | ||
value_type = bool | ||
entity = Person | ||
definition_period = MONTH | ||
|
@@ -29,23 +29,99 @@ class ks_contrib_duration_satisfied(Variable): | |
def formula(persons, period): | ||
return persons('ks_contrib_duration', period) >= 3 | ||
|
||
class homestart_grant(Variable): | ||
class homestart_grant__kiwisaver(Variable): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does the double underscore indicate? |
||
value_type = float | ||
entity = Person | ||
definition_period = MONTH | ||
label = u"Amount available to you from the Homestart grant" | ||
|
||
def formula(persons, period): | ||
duration = persons('ks_contrib_duration', period) | ||
HS_grant = persons('ks_contrib_duration', period) * persons('ks_contrib_duration_satisfied', period) * 1000 | ||
return clip(HS_grant,0,5000) | ||
|
||
|
||
class purc_price(Variable): | ||
value_type = int | ||
entity = Titled_Property | ||
entity = Person | ||
definition_period = YEAR | ||
label = u"Purchase price of the proposed home" | ||
|
||
|
||
class lvr_deposit_req__kiwisaver(Variable): | ||
value_type = float | ||
entity = Person | ||
definition_period = MONTH | ||
label = u"Loan to value ratio deposit requirement" | ||
|
||
def formula(persons, period): | ||
return persons('purc_price', period) * 0.2 | ||
|
||
|
||
class homestart_deposit_req__kiwisaver(Variable): | ||
value_type = float | ||
entity = Person | ||
definition_period = MONTH | ||
label = u"Homestart grant deposit requirement" | ||
|
||
def formula(persons, period): | ||
return persons('purc_price', period) * 0.1 | ||
|
||
|
||
class total_savings__kiwisaver(Variable): | ||
value_type = float | ||
entity = Person | ||
definition_period = MONTH | ||
label = u"Homestart grant deposit requirement" | ||
|
||
def formula(persons, period): | ||
return persons('savings__kiwisaver', period) + persons('homestart_grant__kiwisaver', period) + persons('net__kiwisaver', period) | ||
|
||
|
||
class gross__kiwisaver(Variable): | ||
value_type = float | ||
entity = Person | ||
definition_period = MONTH | ||
label = u"Gross kiwi saver balance" | ||
|
||
|
||
class net__kiwisaver(Variable): | ||
value_type = float | ||
entity = Person | ||
definition_period = MONTH | ||
label = u"Gross kiwi saver balance" | ||
|
||
def formula(persons, period): | ||
return persons('gross__kiwisaver', period) - 1000 | ||
|
||
|
||
# The savings variable is for the purposes of calculating how much deposit, it's not part of the kiwisaver legislation | ||
class savings__kiwisaver(Variable): | ||
value_type = float | ||
entity = Person | ||
definition_period = MONTH | ||
label = u"Personal cash savings in bank" | ||
|
||
|
||
class homestart_deposit_eligible(Variable): | ||
value_type = float | ||
entity = Person | ||
definition_period = MONTH | ||
label = u"Deposit amount needed to be eligble for homestart grant" | ||
|
||
def formula(persons, period): | ||
return persons('total_savings__kiwisaver', period) >= persons('homestart_deposit_req__kiwisaver', period) | ||
|
||
|
||
class lvr_deposit_eligible(Variable): | ||
value_type = float | ||
entity = Person | ||
definition_period = MONTH | ||
label = u"Deposit amount needed to be eligble for homestart grant" | ||
|
||
def formula(persons, period): | ||
return persons('total_savings__kiwisaver', period) >= persons('lvr_deposit_req__kiwisaver', period) | ||
|
||
|
||
class indv_income_per_hs_grant(Variable): | ||
value_type = int | ||
entity = Person | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class name is used twice in this file.