diff --git a/changelog.d/257.md b/changelog.d/257.md new file mode 100644 index 000000000..b3f1e1a5d --- /dev/null +++ b/changelog.d/257.md @@ -0,0 +1 @@ +- Fix `AttributeError` in `cps.marriage_tax_reforms` when reform was instantiated with `child_education_levels` — replace nonexistent `np.is_in` (typo) with `np.isin`. diff --git a/policyengine_uk/reforms/cps/marriage_tax_reforms.py b/policyengine_uk/reforms/cps/marriage_tax_reforms.py index accc83f80..21635024d 100644 --- a/policyengine_uk/reforms/cps/marriage_tax_reforms.py +++ b/policyengine_uk/reforms/cps/marriage_tax_reforms.py @@ -19,7 +19,7 @@ def formula(person, period): child_meets_age_condition = person("age", period) <= max_child_age return benunit.any(child_meets_age_condition) if child_education_levels is not None: - child_meets_education_condition = np.is_in( + child_meets_education_condition = np.isin( person("education_level", period).decode_to_str(), child_education_levels, ) @@ -110,7 +110,7 @@ def formula(person, period): child_meets_age_condition = person("age", period) <= max_child_age return benunit.any(child_meets_age_condition) if child_education_levels is not None: - child_meets_education_condition = np.is_in( + child_meets_education_condition = np.isin( person("education_level", period).decode_to_str(), child_education_levels, )