Skip to content

gdiff: copied subnodes aren't renamed/recolored after parent copy #70

@wshlavacek

Description

@wshlavacek

Location: bionetgen/core/tools/gdiff.py:714

Original marker:

# TODO: Need to get in there and rename and recolor each
# node under the one we just copied

When gdiff copies a node into a derived graph (e.g. when a node exists in one model but not the other), the parent node gets a fresh ID via _set_node_id and the rename map is updated, but the loop below only walks the immediate copy's properties — it does not recurse into the children to rename and recolor them. The result is a graphml output where the copied subtree carries duplicated IDs from the original subtree, which can break downstream graph consumers.

What would unblock this: decide whether the children should:

  1. Get fresh IDs derived from the parent's new ID (current rename-map convention), and
  2. Get the parent's color or retain their original colors.

If "fresh IDs + parent color," thread _set_node_id and _set_node_color calls into the existing child-walking loop. If colors should be preserved per-child, only IDs need rewriting.

Discovered during: non-Atomizer TODO/FIXME triage sweep, 2026-05-08.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions