File tree Expand file tree Collapse file tree 4 files changed +9
-7
lines changed
Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 2424 - name : Install dependencies
2525 run : |
2626 python -m pip install --upgrade pip
27- pip install black==25.1.0
27+ pip install black
2828 - name : Check formatting
2929 run : black . -l 79 --check
3030 test :
Original file line number Diff line number Diff line change 1+ - bump : patch
2+ changes :
3+ fixed :
4+ - Use region.values for Scotland comparisons in loss function to ensure consistent behavior with StringArray types
Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ def test_scotland_uc_households_child_under_1(baseline):
1818 Target: ~14,000 households (13,992 from Stat-Xplore November 2023)
1919 Source: DWP Stat-Xplore UC Households dataset
2020 """
21- region = baseline .calculate (
22- "region" , map_to = "household" , period = 2025
23- ).values
21+ region = baseline .calculate ("region" , map_to = "household" , period = 2025 )
2422 uc = baseline .calculate ("universal_credit" , period = 2025 ).values
2523 household_weight = baseline .calculate (
2624 "household_weight" , map_to = "household" , period = 2025
@@ -38,7 +36,7 @@ def test_scotland_uc_households_child_under_1(baseline):
3836 )
3937
4038 scotland_uc_child_under_1 = (
41- (region == "SCOTLAND" ) & (uc > 0 ) & has_child_under_1
39+ (region . values == "SCOTLAND" ) & (uc > 0 ) & has_child_under_1
4240 )
4341 total = (household_weight * scotland_uc_child_under_1 ).sum ()
4442
Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ def pe_count(*variables):
267267 # Children under 16 in Scotland
268268 # Source: NRS mid-year population estimates
269269 # https://www.nrscotland.gov.uk/statistics-and-data/statistics/statistics-by-theme/population/population-estimates/mid-year-population-estimates
270- scotland_children_under_16 = (region == "SCOTLAND" ) & (age < 16 )
270+ scotland_children_under_16 = (region . values == "SCOTLAND" ) & (age < 16 )
271271 df ["ons/scotland_children_under_16" ] = household_from_person (
272272 scotland_children_under_16
273273 )
@@ -276,7 +276,7 @@ def pe_count(*variables):
276276 # Source: NRS Vital Events - births registered in Scotland
277277 # https://www.nrscotland.gov.uk/publications/vital-events-reference-tables-2024/
278278 # ~46,000 births per year (45,763 in 2024)
279- scotland_babies_under_1 = (region == "SCOTLAND" ) & (age < 1 )
279+ scotland_babies_under_1 = (region . values == "SCOTLAND" ) & (age < 1 )
280280 df ["ons/scotland_babies_under_1" ] = household_from_person (
281281 scotland_babies_under_1
282282 )
You can’t perform that action at this time.
0 commit comments