From 5b1ce1190d311c713b2ee59a0a1e0f827b6995d1 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 29 Mar 2026 23:56:33 -0400 Subject: [PATCH] Fix uprate_rent StringArray lookup --- changelog.d/uprate-rent-stringarray.fixed.md | 1 + policyengine_uk/data/economic_assumptions.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/uprate-rent-stringarray.fixed.md diff --git a/changelog.d/uprate-rent-stringarray.fixed.md b/changelog.d/uprate-rent-stringarray.fixed.md new file mode 100644 index 000000000..efe61e75b --- /dev/null +++ b/changelog.d/uprate-rent-stringarray.fixed.md @@ -0,0 +1 @@ +- Ensure `uprate_rent` passes a NumPy array into vectorial parameter lookup for regional private rent growth. diff --git a/policyengine_uk/data/economic_assumptions.py b/policyengine_uk/data/economic_assumptions.py index 1b33994f9..1a4a957d4 100644 --- a/policyengine_uk/data/economic_assumptions.py +++ b/policyengine_uk/data/economic_assumptions.py @@ -177,7 +177,7 @@ def uprate_rent( elif year < 2025: # We have regional growth rates for private rent. regional_growth_rate = growth.ons.private_rental_prices(year)[ - region.values.astype(str) + np.array(region.values.astype(str)) ] current_year.household["rent"] = np.where( is_private_rented,