Repository navigation
Conversation
igraphmodule_PyObject_to_attribute_values(), used for the weights of pagerank(), personalized_pagerank() and constraint() and for the capacities of the flow and cut functions, replaced every list item that was not an int or float with 1, and treated any sequence other than a list as an attribute name. As a result, pagerank(weights=["a", "b"]) silently returned unweighted results, while strength() raised ValueError for the same input. Large integers overflowed with a pending exception. It now delegates to igraphmodule_attrib_to_vector_t(), like most other functions that take weights: non-numeric values in a sequence or an attribute raise ValueError, and any sequence (tuples, NumPy arrays) is accepted. Missing (None) attribute values are now rejected too, instead of being replaced by 1. Unknown attribute names given to weight-like arguments now raise KeyError in all functions. Previously the flow functions raised KeyError, while the others raised InternalError. Assisted-by: Claude Opus 5.5
Graph.Chung_Lu(), Graph.Establishment(), Graph.layout_umap() and umap_compute_weights() converted their real-valued vector arguments (vertex weights, type distribution, distances and edge weights) with the integer conversion function, silently truncating every value. For example, Graph.Chung_Lu([0.9] * 1000) always returned a graph without edges, and Graph.Establishment() rejected [0.3, 0.7] as a type distribution. The expected values of the umap_compute_weights() test were computed from the truncated distances and are updated. Negative values are now reported by the C core instead of the Python interface. Assisted-by: Claude Opus 5.5
Assisted-by: Claude Opus 5.5
szhorvat
force-pushed
the
fix/numeric-arg-validation
branch
from
November 29, 2026 22:15
93ac1c6 to
46dc1a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.