Skip to content

Fix np.is_in typo in cps.marriage_tax_reforms (#257)#1637

Merged
MaxGhenis merged 1 commit intomainfrom
fix-np-is-in-typo-marriage-reforms
Apr 20, 2026
Merged

Fix np.is_in typo in cps.marriage_tax_reforms (#257)#1637
MaxGhenis merged 1 commit intomainfrom
fix-np-is-in-typo-marriage-reforms

Conversation

@vahid-ahmadi
Copy link
Copy Markdown
Collaborator

Summary

  • Replace nonexistent np.is_in(...) with np.isin(...) in policyengine_uk/reforms/cps/marriage_tax_reforms.py lines 22 and 113.
  • np.is_in (with underscore) does not exist in numpy. Both call sites sit inside if child_education_levels is not None: branches, so the typo only triggers when the reform is instantiated with that argument — at which point it raises AttributeError.

Found while auditing #257.

Test plan

  • Module imports cleanly: python -c "from policyengine_uk.reforms.cps.marriage_tax_reforms import *"
  • make format clean

🤖 Generated with Claude Code

`np.is_in` is not a numpy function — the correct name is `np.isin`.
Both call sites sit inside `if child_education_levels is not None:`
branches, so the typo only surfaces when the reform is instantiated
with that argument. Replace with `np.isin` so the reform doesn't
crash with AttributeError when exercised.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vahid-ahmadi vahid-ahmadi self-assigned this Apr 20, 2026
Copy link
Copy Markdown
Collaborator

@MaxGhenis MaxGhenis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np.is_in -> np.isin. Trivial and correct.

@MaxGhenis MaxGhenis merged commit 8f92037 into main Apr 20, 2026
8 checks passed
@MaxGhenis MaxGhenis deleted the fix-np-is-in-typo-marriage-reforms branch April 20, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants