Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-canada into YiweiJ/issue470
  • Loading branch information
YiweiJ committed Nov 29, 2023
2 parents d4d9ab9 + 9e92f43 commit 6bb91f4
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.87.0] - 2023-11-09 20:50:26

### Added

- New Brunswick pension benefit.

## [0.86.2] - 2023-10-08 04:38:29

## [0.86.1] - 2023-10-06 11:22:22
Expand Down Expand Up @@ -670,6 +676,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



[0.87.0]: https://github.com/PolicyEngine/policyengine-canada/compare/0.86.2...0.87.0
[0.86.2]: https://github.com/PolicyEngine/policyengine-canada/compare/0.86.1...0.86.2
[0.86.1]: https://github.com/PolicyEngine/policyengine-canada/compare/0.86.0...0.86.1
[0.86.0]: https://github.com/PolicyEngine/policyengine-canada/compare/0.85.1...0.86.0
Expand Down
5 changes: 5 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -556,3 +556,8 @@
removed:
- numpy pin.
date: 2023-10-08 04:38:29
- bump: minor
changes:
added:
- New Brunswick pension benefit.
date: 2023-11-09 20:50:26
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: New Brunswick provides this maximum pension benefit.
values:
2022-01-01: 1_000
metadata:
unit: currency-CAD
label: New Brunswick pension benefit max amount
reference:
- title: Government of Canada - Province of New Brunswick
href: https://www.canada.ca/en/revenue-agency/services/forms-publications/tax-packages-years/general-income-tax-benefit-package/new-brunswick/5004-pc/information-residents-new-brunswick.html#P64_5140
- title: New Brunswick Income Tax Act
href: https://laws.gnb.ca/en/pdf/cs/N-6.001.pdf#page=31
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: Max Pension Benefit
period: 2023
input:
province_code: NB
pension_and_savings_plan_income: 20_000
output:
nb_pension_benefit: 1_000

- name: Pension Benefit Below Maximum Amount
period: 2023
input:
province_code: NB
pension_and_savings_plan_income: 800
output:
nb_pension_benefit: 800

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from policyengine_canada.model_api import *


class nb_pension_benefit(Variable):
value_type = float
entity = Person
label = "New Brunswick pension benefit"
unit = CAD
definition_period = YEAR
defined_for = ProvinceCode.NB

def formula(person, period, parameters):
age = person("age", period)
pension_income = person("pension_and_savings_plan_income", period)
max_amount = parameters(
period
).gov.provinces.nb.benefits.pension_benefit.cap
# Capped at a certain amount
return min_(max_amount, pension_income)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

setup(
name="policyengine-canada",
version="0.86.2",
version="0.87.0",
author="PolicyEngine",
author_email="[email protected]",
classifiers=[
Expand Down

0 comments on commit 6bb91f4

Please sign in to comment.