Skip to content

Commit ac3aba4

Browse files
vahid-ahmadiclaude
andauthored
Use np.isin for country check in winter_fuel_allowance (#257) (#1650)
One of the last OR-chained equality checks in the codebase. All 6 baseline winter-fuel YAML tests still pass. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a9e85fd commit ac3aba4

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

changelog.d/257-winter-fuel.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Use `np.isin` instead of OR-chained equality in `winter_fuel_allowance`.

policyengine_uk/variables/gov/dwp/winter_fuel_allowance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def formula(household, period, parameters):
2929
taxable_income = household.members("total_income", period)
3030
is_SP_age = household.members("is_SP_age", period)
3131
country = household("country", period).decode_to_str()
32-
in_england_or_wales = (country == "ENGLAND") | (country == "WALES")
32+
in_england_or_wales = np.isin(country, ["ENGLAND", "WALES"])
3333
meets_income_passport = (
3434
household.any(
3535
is_SP_age

0 commit comments

Comments
 (0)