From a0618773a2a16ec1923269a77bd9e7d24827b21f Mon Sep 17 00:00:00 2001 From: Vahid Ahmadi Date: Tue, 14 Jan 2025 15:44:41 +0000 Subject: [PATCH] Fix bitwise AND operation error --- .../dwp/tax_free_childcare/tax_free_childcare_benefits.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/policyengine_uk/variables/gov/dwp/tax_free_childcare/tax_free_childcare_benefits.py b/policyengine_uk/variables/gov/dwp/tax_free_childcare/tax_free_childcare_benefits.py index c9e96abd..fddc54a1 100644 --- a/policyengine_uk/variables/gov/dwp/tax_free_childcare/tax_free_childcare_benefits.py +++ b/policyengine_uk/variables/gov/dwp/tax_free_childcare/tax_free_childcare_benefits.py @@ -37,8 +37,9 @@ def formula(benunit, period, parameters): "incompatibilities_childcare_eligible", period ).astype(bool) - is_eligible = ( - meets_age_condition & meets_income_condition & childcare_eligible + # Combine conditions using logical AND + is_eligible = np.logical_and.reduce( + [meets_age_condition, meets_income_condition, childcare_eligible] ) # Calculate per-child amounts at the person level