Repository navigation
Fix validate_undirected_sbm() check and print.undirected_sbm() output - #73
Draft
alexpghayes wants to merge 1 commit into
Draft
alexpghayes wants to merge 1 commit into
alexpghayes wants to merge 1 commit into
Conversation
- `any(distinct_theta_by_block) > 1` compared a logical with 1, so the "theta must be equal within a block" check could never fire. Use `any(distinct_theta_by_block > 1)`. - print.undirected_sbm() printed `x$edge_distribution`, a field that doesn't exist. glue() returned character(0), so the line and the blank line after it silently disappeared. Remove it: Poisson edges and self loops are already printed below. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Bugs
validate_undirected_sbm()could never fire.if (any(distinct_theta_by_block) > 1)(R/undirected_sbm.R:16) compares a logical with 1, so it was alwaysFALSE, and an SBM whosethetavaries within a block passed validation.print.undirected_sbm()printed a field that doesn't exist.x$edge_distributionisNULL, soglue()returnedcharacter(0). That line and the blank line after it silently disappeared, and "Factor model parameterization" ran straight on from the block probabilities.Fix
any(distinct_theta_by_block > 1).edge_distributionline and keep the section break.poisson_edgesandallow_self_loopsare already printed further down, like the other print methods.Tests
Added to
tests/testthat/test-undirected-sbms.R. Settingm$theta <- 1:10on an SBM now fails validation, and the print output has its section break. Fails onmain(2 failures), passes here. Full suite passes. Noman/changes.NEWS
Left out to avoid conflicting with #59. Probably not worth a bullet. If you want one, under Bug fixes:
🤖 Generated with Claude Code