Skip to content

Commit 4a54edd

Browse files
MaxGhenisclaudevahid-ahmadi
authored
Fix misleading parameter/variable metadata (Tax Credits min_benefit currency, benunit_weekly_hours label) (#1627)
* Fix misleading metadata: tax_credits min_benefit currency, benunit_weekly_hours label Two unrelated one-line fixes bundled into a single cosmetic PR: - `gov.dwp.tax_credits.min_benefit` had `unit: currency-USD`; this is a UK statutory threshold in pounds, should be `currency-GBP`. - `benunit_weekly_hours` label says "Average weekly hours worked by adults in the benefit unit", but the formula is `adds = ["weekly_hours"]` — it's a sum, not an average. Relabels as "Total weekly hours worked by adults in the benefit unit". Both surfaced during a sweep in the #1621 tracking issue. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Relax exact-float YAML assertions in policy tests --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Vahid Ahmadi <va.vahidahmadi@gmail.com>
1 parent 4d97914 commit 4a54edd

7 files changed

Lines changed: 18 additions & 16 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Fix `gov.dwp.tax_credits.min_benefit` parameter unit from `currency-USD` to `currency-GBP` — the parameter is a UK statutory threshold in pounds.
2+
- Correct `benunit_weekly_hours` label from "Average weekly hours worked by adults in the benefit unit" to "Total weekly hours worked by adults in the benefit unit" — the formula is `adds = ["weekly_hours"]`, which sums rather than averages.

policyengine_uk/parameters/gov/dwp/tax_credits/min_benefit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ metadata:
77
reference:
88
- href: https://www.legislation.gov.uk/uksi/2002/2008/regulation/9
99
name: The Tax Credits (Income Thresholds and Determination of Rates) Regulations 2002
10-
unit: currency-USD
10+
unit: currency-GBP
1111
values:
1212
2002-08-01: 26

policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/childcare_element/uc_childcare_element.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- name: No childcare, no element
22
period: 2020
3-
absolute_error_margin: 0
3+
absolute_error_margin: 0.001
44
input:
55
people:
66
parent:
@@ -15,7 +15,7 @@
1515

1616
- name: Childcare for one child under limit
1717
period: 2020
18-
absolute_error_margin: 0
18+
absolute_error_margin: 0.001
1919
input:
2020
people:
2121
parent:
@@ -30,7 +30,7 @@
3030

3131
- name: Childcare for one child over limit
3232
period: 2020
33-
absolute_error_margin: 0
33+
absolute_error_margin: 0.001
3434
input:
3535
people:
3636
parent:

policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/housing_costs_element/non_dep_deduction/uc_individual_non_dep_deduction.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- name: Fully liable
22
period: 2020
3-
absolute_error_margin: 0
3+
absolute_error_margin: 0.001
44
input:
55
people:
66
person:
@@ -15,7 +15,7 @@
1515

1616
- name: Exempt, no deduction
1717
period: 2020
18-
absolute_error_margin: 0
18+
absolute_error_margin: 0.001
1919
input:
2020
people:
2121
person:
@@ -30,7 +30,7 @@
3030

3131
- name: Too young, no deduction
3232
period: 2020
33-
absolute_error_margin: 0
33+
absolute_error_margin: 0.001
3434
input:
3535
people:
3636
person:

policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/income/uc_income_reduction.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- name: Reductions apply at correct rates
22
period: 2021
3-
absolute_error_margin: 0
3+
absolute_error_margin: 0.001
44
input:
55
uc_earned_income: 10
66
uc_unearned_income: 1
@@ -10,7 +10,7 @@
1010

1111
- name: Capped at max amount
1212
period: 2025
13-
absolute_error_margin: 0
13+
absolute_error_margin: 0.001
1414
input:
1515
uc_earned_income: 1_000
1616
uc_unearned_income: 400
@@ -20,7 +20,7 @@
2020

2121
- name: Uncapped at max amount
2222
period: 2025
23-
absolute_error_margin: 0
23+
absolute_error_margin: 0.001
2424
input:
2525
uc_earned_income: 1_000
2626
uc_unearned_income: 400

policyengine_uk/tests/policy/baseline/finance/income/minimum_wage.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
- name: Minimum wage for a person over 25
22
period: 2021
3-
absolute_error_margin: 0
3+
absolute_error_margin: 0.001
44
input:
55
age: 30
66
output:
77
minimum_wage: 8.91
88

99
- name: Minimum wage for a person aged 18 uses the 18 to 20 bracket
1010
period: 2025
11-
absolute_error_margin: 0
11+
absolute_error_margin: 0.001
1212
input:
1313
age: 18
1414
output:
1515
minimum_wage: 10
1616

1717
- name: Minimum wage for a person aged 21 uses the 21 to 22 bracket
1818
period: 2025
19-
absolute_error_margin: 0
19+
absolute_error_margin: 0.001
2020
input:
2121
age: 21
2222
output:
2323
minimum_wage: 12.21
2424

2525
- name: Minimum wage for a person aged 23 uses the 23 to 24 bracket
2626
period: 2025
27-
absolute_error_margin: 0
27+
absolute_error_margin: 0.001
2828
input:
2929
age: 23
3030
output:
3131
minimum_wage: 12.21
3232

3333
- name: Minimum wage for a person aged 25 uses the 25 or over bracket
3434
period: 2021
35-
absolute_error_margin: 0
35+
absolute_error_margin: 0.001
3636
input:
3737
age: 25
3838
output:

policyengine_uk/variables/household/income/benunit_weekly_hours.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class benunit_weekly_hours(Variable):
55
value_type = float
66
entity = BenUnit
7-
label = "Average weekly hours worked by adults in the benefit unit"
7+
label = "Total weekly hours worked by adults in the benefit unit"
88
definition_period = YEAR
99
unit = "hour"
1010

0 commit comments

Comments
 (0)