From d986f2181a19791efebb9a2523d726ee2d781be7 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Tue, 2 Dec 2025 11:03:19 -0500 Subject: [PATCH 1/2] Allow numpy 2.3+ for Python 3.14 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NumPy 2.1.x has a bug on Python 3.14 where "temporary elision" optimization incorrectly identifies arrays as temporary due to the new LOAD_FAST_BORROW bytecode instruction, causing destructive in-place modifications. This caused dividend_income_tax to return £0 instead of £22bn in UK microsimulations. Fix: numpy/numpy#28748 (released in NumPy 2.3.0) Issue: numpy/numpy#28681 Closes #407 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 21c15256..f7b41f99 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,9 @@ general_requirements = [ "pytest>=8,<9", - "numpy~=2.1.0", + # NumPy 2.3+ required for Python 3.14 due to temporary elision bug fix + # See: https://github.com/numpy/numpy/issues/28681 + "numpy>=2.1.0,<3", "sortedcontainers<3", "numexpr<3", "dpath<3", From ed8365d0bba82c9902292c1e67f2d5e83317718a Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Tue, 2 Dec 2025 11:04:57 -0500 Subject: [PATCH 2/2] Add changelog entry for numpy Python 3.14 fix --- changelog_entry.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29b..0824f0cb 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - Allow NumPy 2.3+ for Python 3.14 compatibility (fixes temporary elision bug causing incorrect microsimulation results)