Skip to content

Conversation

@fabratu
Copy link
Member

@fabratu fabratu commented Nov 3, 2025

This PR addresses issues raised in #1368. While looking more deeply into the data types used as input in addEdges, numpy array sizes are int64 or int32 (platform dependent). SciPy COO matrix rows/columns are either of type int32 or int64, depending on the input size. As a result, the internal data types are changed to signed equivalents, and using views effectively avoids copies of rows/columns from input data.

In addition, this adds backward compatibility for addEdges (and therefore GraphFromCoo).

With this code, the code snippet from #1368 works with NumPy 1.26.4.

@fabratu fabratu force-pushed the 20251103_np_1_error branch from 3facafa to 752ddb8 Compare November 3, 2025 09:15
@coveralls
Copy link

Pull Request Test Coverage Report for Build 19029508561

Details

  • 16 of 27 (59.26%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 79.235%

Changes Missing Coverage Covered Lines Changed/Added Lines %
networkit/graph.pyx 16 27 59.26%
Totals Coverage Status
Change from base Build 19009863535: -0.02%
Covered Lines: 29419
Relevant Lines: 37129

💛 - Coveralls

Copy link
Contributor

@domischweisgut domischweisgut left a comment

Choose a reason for hiding this comment

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

Looks fine :)

@fabratu fabratu merged commit f0f00c7 into networkit:master Nov 5, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants