Skip to content

Snapshot mutable property values when saving filter history - #346

Open
xixihaha-ha wants to merge 1 commit into
rlabbe:masterfrom
xixihaha-ha:fix/saver-properties-20261104
Open

xixihaha-ha wants to merge 1 commit into
rlabbe:masterfrom
xixihaha-ha:fix/saver-properties-20261104

Conversation

@xixihaha-ha

Copy link
Copy Markdown

Saver.save copies ordinary instance attributes but appends property values by reference. If a property exposes a mutable array or nested container, subsequent filter updates silently rewrite previously saved history.

Deep-copy property values when taking each snapshot, consistently with the existing attribute snapshots. Tests exercise in-place array updates, nested-list mutations, independence between snapshots and the live model, and ignored properties.

Validation: the history regression fails on unchanged main and passes with the fix. The full common helper/discretization tests report 16 passed (Python 3.11 / NumPy 1.26).

AI assistance was used to investigate, implement and test this change.

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.

1 participant