Repository navigation
Check within_block / a and between_block / b in planted_partition() - #65
Draft
alexpghayes wants to merge 1 commit into
Draft
alexpghayes wants to merge 1 commit into
alexpghayes wants to merge 1 commit into
Conversation
planted_partition() silently ignored `a` when `within_block` was given (and `b` when `between_block` was given), and with neither failed with "replacement diagonal has wrong length". Copy the argument checks from directed_planted_partition(): each probability must be given exactly one way, and both are required. 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.
Bug
planted_partition()(R/undirected_planted_partition.R) silently ignoredawhenwithin_blockwas given, andbwhenbetween_blockwas given. With neither given it failed with the cryptic "replacement diagonal has wrong length".Fix
Copy the argument checks from
directed_planted_partition():within_block,between_block,aandbmust be scalars;"Must specify only one ofwithin_blockanda."(and likewise forbetween_block/b);"Must specify eitherwithin_blockandbetween_block, oraandb."when either probability is missing.Mixing the two parameterizations (e.g.
within_blockwithb) still works, as in the directed version.Tests
Added to
tests/testthat/test-undirected-planted-partition.R. Fails onmain(2 failures, 1 error), passes here. Full suite passes. Noman/changes.NEWS
Left out to avoid conflicting with #59. Suggested bullet under Bug fixes:
🤖 Generated with Claude Code