Skip to content

Conversation

@bokveizen
Copy link

@bokveizen bokveizen commented May 11, 2024

Reference Issues/PRs

See Issue #1055
See Pull Request #1056 (comment)

What does this implement/fix? Briefly explain your changes.

Expected Behavior

Any size-1 block should just have zero probability.

Actual Behavior

In sbm_estimators.py, _calculate_block_p calls _calculate_p, which divides zero when block.size = 0.
This can happen when some block has size one and loops=False is used.

Adding

if block.size == 0:
    continue

before Line 519 of graspologic/graspologic/models/sbm_estimators.py should do the trick.

bug fix for size-one blocks with loops=False
@bdpedigo
Copy link
Collaborator

hi @bokveizen, are you able to give edit access for maintainers on this PR?

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.

3 participants