Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/test_outcome_allowlist.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@
# Keep entries narrow. An entry that matches nothing in a run is reported as a
# warning; remove it once its bug is fixed. Failures can never be accepted.

[[allow]]
nodeid = "policyengine_uk/tests/test_subsample.py::test_neutralized_inputs_and_model_values_survive_subsampling[[]*]"
outcome = "xfailed"
reason = "^needs policyengine-core holder resync$"
why = "Issue #2254 / PR #2265 waits for core to resync restored holders after subsampling. Both ownership variants retain every assertion under strict xfail."

[[allow]]
nodeid = "policyengine_uk/tests/test_input_records.py::test_restoring_reform_can_replace_a_neutralized_input[[]subsampled-*]"
outcome = "xfailed"
reason = "^needs policyengine-core holder resync$"
why = "Issue #2254 / PR #2265 waits for core to accept writes immediately after restoring a subsampled holder. Direct supplied/model controls remain unmarked."

[[allow]]
nodeid = "policyengine_uk/tests/test_uc_state_pension_properties.py::test_state_pension_does_not_change_partners_marriage_allowance"
outcome = "xfailed"
Expand Down
1 change: 1 addition & 0 deletions changelog.d/core-3349.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Require policyengine-core 3.34.9 or later. From that release, an input set on a variable that a reform has neutralised has no effect, as core documents, so a reform that restores the variable reads the input supplied before neutralisation.
10 changes: 9 additions & 1 deletion policyengine_uk/tests/test_capital_gains_projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,8 +1068,16 @@ def apply(self):
simulation.apply_reform(
{"gov.abolitions.capital_gains_before_response": {"2026": False}}
)
# Core ignores inputs to a neutralized variable
# (TaxBenefitSystem.neutralize_variable), so it drops the 555 set under
# NeutralizeGains and the restored variable reads the situation's 120,000.
# The abolition parameter leaves the variable's definition in place, so
# core stores that 555.
expected = 120_000 if route == "neutralize_variable" else 555
with pytest.warns(UserWarning, match="supplied"):
assert simulation.calculate("capital_gains_before_response", 2026)[0] == 555
assert (
simulation.calculate("capital_gains_before_response", 2026)[0] == expected
)
restored_record = simulation.capital_gains_projection_metadata["application"][
"by_variable"
]["capital_gains_before_response"]["2026"]
Expand Down
13 changes: 1 addition & 12 deletions policyengine_uk/tests/test_input_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,7 @@ def test_rebuilt_populations_forget_the_inputs_they_replace():
@pytest.mark.parametrize("model", [False, True], ids=["supplied", "model"])
@pytest.mark.parametrize(
"subsampled",
[
pytest.param(False, id="direct"),
pytest.param(
True,
id="subsampled",
marks=pytest.mark.xfail(
strict=True,
raises=AssertionError,
reason="needs policyengine-core holder resync",
),
),
],
[pytest.param(False, id="direct"), pytest.param(True, id="subsampled")],
)
def test_restoring_reform_can_replace_a_neutralized_input(model, subsampled):
"""A write after restoration replaces the hidden value and its ownership."""
Expand Down
5 changes: 0 additions & 5 deletions policyengine_uk/tests/test_subsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,6 @@ def test_a_model_value_stays_the_models():


@pytest.mark.parametrize("model", [False, True], ids=["supplied", "model"])
@pytest.mark.xfail(
strict=True,
raises=AssertionError,
reason="needs policyengine-core holder resync",
)
def test_neutralized_inputs_and_model_values_survive_subsampling(model):
"""Neutralisation hides stored inputs without discarding them or their owner."""
data = dataset([(100.0, [1]), (100.0, [1])])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [
]
requires-python = ">=3.11"
dependencies = [
"policyengine-core>=3.33.0",
"policyengine-core>=3.34.9",
"microdf-python>=1.2.1",
"pydantic>=2.11.7",
"tables>=3.10.2",
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading