Skip to content

DOC: Add examples to contracted_nodes. - #7856

Merged
dschult merged 3 commits into
networkx:mainfrom
rossbar:document-contracted
Sep 7, 2025
Merged

dschult merged 3 commits into
networkx:mainfrom
rossbar:document-contracted

Conversation

@rossbar

@rossbar rossbar commented Feb 15, 2025 •

Copy link
Copy Markdown
Contributor

Adds a more extensive examples section to contracted_nodes to highlight behavior in a myriad of cases:

  • Highlights the handling of contracted nodes, the "contraction" attribute, and any edges that result from the contraction (and their attributes). Includes explicit examples for both non-multigraphs and multigraphs.
  • More detail on self_loops and how self-loops in the original graph are handled by contraction

Closes #7781
Closes #7660

rossbar added 3 commits July 10, 2025 01:51
Adds a more extensive examples section to contracted_nodes to
highlight behavior in a myriad of cases.
@rossbar
rossbar force-pushed the document-contracted branch from c41d312 to 9a000cb Compare July 10, 2025 08:53

@rossbar rossbar left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I went ahead and rebased this on main to make sure everything is up-to-date.

It turns out that there are now more features to document with #7902 having been merged. My preference would be to handle additional examples for that particular feature in a follow-up PR to this one: the diff here is already pretty unruly due to the added examples!

However, if folks prefer that I mash it all into here just LMK and I will work on it!

@dschult dschult left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is quite clear and very helpful.
Thanks @rossbar! and sorry for the long delay in review. :}

@dschult
dschult merged commit ac0d67b into networkx:main Sep 7, 2025
@dschult dschult added this to the 3.6 milestone Sep 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Invalid link weight when contracting

2 participants