Skip to content

fix weighted_outdegree calculations and add tests#253

Merged
M-Lampert merged 3 commits intomainfrom
fix/weighted_outdegree
May 23, 2025
Merged

fix weighted_outdegree calculations and add tests#253
M-Lampert merged 3 commits intomainfrom
fix/weighted_outdegree

Conversation

@M-Lampert
Copy link
Copy Markdown
Contributor

No description provided.

@M-Lampert M-Lampert requested a review from Copilot May 23, 2025 15:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for graphs without explicit edge weights by providing default weights and introduces tests for the new weighted_outdegrees and transition_probabilities methods.

  • Adds fallback logic in weighted_outdegrees and transition_probabilities when edge_weight is undefined
  • Adds unit tests covering both unweighted and weighted cases for out-degrees and transition probabilities

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tests/core/test_graph.py New tests for weighted_outdegrees and transition_probabilities
src/pathpyG/core/graph.py Fallback to uniform weights when edge_weight is missing; code changes

Comment thread src/pathpyG/core/graph.py Outdated
Comment thread src/pathpyG/core/graph.py Outdated
Comment thread tests/core/test_graph.py
M-Lampert and others added 2 commits May 23, 2025 17:32
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@M-Lampert M-Lampert merged commit dfbe714 into main May 23, 2025
4 checks passed
@M-Lampert M-Lampert deleted the fix/weighted_outdegree branch June 13, 2025 15:51
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.

2 participants