Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Keep nodes without edges in to_networkx - #646

Open
eriknw wants to merge 1 commit into
42-networkx-structural-ingestfrom
43-networkx-to-networkx-nodes
Open

eriknw wants to merge 1 commit into
42-networkx-structural-ingestfrom
43-networkx-to-networkx-nodes

Conversation

@eriknw

@eriknw eriknw commented Oct 19, 2026

Copy link
Copy Markdown
Member

to_networkx built its DiGraph from the entries alone, so a node with no edges
vanished, and the nodes came out in the order the sorted entries named them. A
5x5 matrix with entries (0, 3), (2, 0), (3, 3) gave nodes [0, 3, 2] and
round-tripped to a permuted 3x3. It now adds range(nrows) first. viz.draw
shows such nodes too, and the user guide's line on to_networkx says what the
nodes are.

@eriknw
eriknw added this pull request to stack #650 October 19, 2026 07:50
@eriknw
eriknw force-pushed the 43-networkx-to-networkx-nodes branch from 685493e to 2a59411 Compare October 19, 2026 07:55
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.78%. Comparing base (808be2c) to head (37b4eb4).

Additional details and impacted files
@@                        Coverage Diff                        @@
##           42-networkx-structural-ingest     #646      +/-   ##
=================================================================
+ Coverage                          98.73%   98.78%   +0.05%     
=================================================================
  Files                                105      105              
  Lines                              30382    30393      +11     
  Branches                            3540     3540              
=================================================================
+ Hits                               29998    30025      +27     
+ Misses                               253      243      -10     
+ Partials                             131      125       -6     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eriknw
eriknw force-pushed the 43-networkx-to-networkx-nodes branch from 2a59411 to 26e29bc Compare October 20, 2026 22:28
@eriknw
eriknw force-pushed the 43-networkx-to-networkx-nodes branch from 26e29bc to 0e6d3b6 Compare October 21, 2026 04:14
@eriknw
eriknw force-pushed the 43-networkx-to-networkx-nodes branch from 0e6d3b6 to 0901634 Compare October 21, 2026 08:38
@eriknw
eriknw removed this pull request from stack #650 October 28, 2026 04:29
@eriknw
eriknw force-pushed the 43-networkx-to-networkx-nodes branch from 0901634 to 869ab7d Compare October 28, 2026 04:29
@eriknw
eriknw added this pull request to stack #653 October 28, 2026 04:30
@eriknw
eriknw removed this pull request from stack #653 October 28, 2026 04:31
@eriknw
eriknw added this pull request to stack #655 October 28, 2026 04:32
@eriknw
eriknw removed this pull request from stack #655 October 28, 2026 04:33
@eriknw
eriknw added this pull request to stack #657 October 28, 2026 04:33
@eriknw
eriknw force-pushed the 43-networkx-to-networkx-nodes branch from 869ab7d to 55f6469 Compare October 28, 2026 13:21
to_networkx built its DiGraph from the matrix's entries alone, so an
index whose row and column are both empty (a node with no edges)
vanished, and the nodes came out in the order the sorted entries first
named them. A 5x5 matrix with entries (0, 3), (2, 0) and (3, 3) became
a graph with nodes [0, 3, 2]; from_networkx then gave back a 3x3 matrix
with rows and columns permuted. viz.draw, which draws through to_networkx, left
such nodes out of the picture.

Add range(nrows) as nodes before the edges, so every row is a node and
the nodes iterate in index order, and from_networkx(to_networkx(M))
gives back M. The user guide's line on to_networkx said it always
labels the values "weight"; it now says what the nodes are and that
edge_attribute names (or drops) the values.
@eriknw
eriknw force-pushed the 43-networkx-to-networkx-nodes branch from 55f6469 to 37b4eb4 Compare October 29, 2026 02:01
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