Skip to content
Merged
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
1 change: 1 addition & 0 deletions changelog.d/fix-ss-state-backend-core-imports.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Give the Social Security input state-machine test's Core backend the operator module and population-count restore stub that policyengine-core 3.33.13 needs, which had made the test fail on main.
15 changes: 12 additions & 3 deletions policyengine_us/tests/core/_social_security_state_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
that one-person situation; _get_person_count and check_type reflect its
fixed shape. Dataset.load supplies the tiny dictionary input payload.
get_parameter returns the fixture's doubling uprating index.
- Dumper _dump_entity/_restore_entity replace entity serialization only;
Disk replaces OnDiskStorage's physical bytes. Public dump/restore bodies,
holder provenance, memory tiers and source restoration remain Core/US code.
- Dumper _dump_entity/_restore_entity/_restore_count replace entity
serialization only; Disk replaces OnDiskStorage's physical bytes. Public
dump/restore bodies, holder provenance, memory tiers and source
restoration remain Core/US code.
"""

from __future__ import annotations
Expand All @@ -38,6 +39,7 @@
import copy
import json
import logging
import operator
import os
import sys
import types
Expand Down Expand Up @@ -528,6 +530,9 @@ def load(self):
PeriodMismatchError=ValueError,
_period_from_storage_key=_period_from_storage_key,
copy=copy,
# Core 3.33.13's build_default_simulation checks its count with
# operator.index.
operator=operator,
)
holder_methods = (
"clone",
Expand Down Expand Up @@ -668,6 +673,10 @@ def module(name, **values):
DUMP_FORMAT_VERSION=1,
_dump_entity=lambda *args: None,
_restore_entity=lambda *args: 1,
# From Core 3.33.13 restore_simulation also restores each
# population's count; the fixture's one-person populations keep
# theirs.
_restore_count=lambda *args: None,
)
execute(
core / "tools/simulation_dumper.py",
Expand Down
Loading