Skip to content

Fix: Deduplicate list elements in 'append_to_list' with 'flatten' - #4014

Merged
ipspace merged 1 commit into
devfrom
fix-append-list
Oct 31, 2026
Merged

ipspace merged 1 commit into
devfrom
fix-append-list

Conversation

@ipspace

@ipspace ipspace commented Oct 31, 2026

Copy link
Copy Markdown
Owner

With 'flatten' set, 'append_to_list' checked whether the whole list was already an element of the target list, and then appended all list elements, including those already in the target list.

This commit:

  • Appends only the list elements that are not already in the target list
  • Converts a scalar value of the target attribute into a one-element list before appending to it

With 'flatten' set, 'append_to_list' checked whether the whole list
was already an element of the target list, and then appended all list
elements, including those already in the target list.

This commit:

* Appends only the list elements that are not already in the target
  list
* Converts a scalar value of the target attribute into a one-element
  list before appending to it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change addresses scalar normalization and element-level deduplication in append_to_list, with documentation updated to reflect the revised behavior and no review issues identified.

No open issues 🎉

What changed in this PR

This pull request fixes append_to_list so flattened list additions are deduplicated element-by-element and scalar target attributes are normalized before appending.

Changes:

  • Converts existing scalar target values into one-element lists.
  • Appends only elements not already present when flatten=True.
  • Updates the helper documentation to describe the revised behavior.
File Description
netsim/​data/​__init__.py Updates append_to_list with scalar normalization and element-level deduplication.

Review effort: Lite

@ipspace
ipspace merged commit 687db58 into dev Oct 31, 2026
9 checks passed
@ipspace
ipspace deleted the fix-append-list branch October 31, 2026 14:30
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