Repository navigation
Reject redundant or contradictory arguments in model constructors - #68
Draft
alexpghayes wants to merge 1 commit into
Draft
alexpghayes wants to merge 1 commit into
alexpghayes wants to merge 1 commit into
Conversation
- directed_dcsbm(): `k_out` / `k_in` that disagree with `dim(B)` are an error instead of being silently ignored. Agreeing values are still allowed, as documented. - mmsbm(): specifying both `k` and `B`, or both `n` and `theta`, is an error, matching dcsbm(). `k = 1` errors clearly instead of failing inside igraph. - mmsbm() and overlapping_sbm(): `force_pure = TRUE` with `n < k` errors clearly. - chung_lu(): specifying both `n` and `theta` is an error. 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
maindirected_dcsbm(n = 10, B = matrix(.1, 2, 3), k_out = 5, k_in = 3)k_outsilently ignoredmmsbm(theta = rep(1, 10), k = 3, B = B)mmsbm(n = 100, theta = rep(1, 10), B = B)nsilently ignoredmmsbm(theta = rep(1, 10), B = matrix(.5))(k = 1)mmsbm()/overlapping_sbm()withforce_pure = TRUEandn < ksample()chung_lu(n = 100, theta = rep(1, 10))nsilently ignoredFix
mmsbm()andchung_lu(): "Must specify only one ofnandtheta, not both." and "Must specify only one ofBandk, not both.", worded as indcsbm().mmsbm()withk < 2: "mmsbm()needs at least two blocks. For a single block, usechung_lu()ordcsbm()."mmsbm()/overlapping_sbm(): "force_pure = TRUEneeds at least as many nodes as blocks (n >= k)." Theoverlapping_sbm()docs already said this.directed_dcsbm()differs from the handoff's suggestion. Its docs explicitly allow givingk_out,k_inandBtogether ("You may specify all three at once"). So instead of an "only one of" error, it now errors only when they contradictB: "k_outmust equalnrow(B)when both are given." (likewise fork_in/ncol(B)). The docs now say that. Happy to switch to a strict "only one of" error likedcsbm(), which would be a breaking change.Tests
New
tests/testthat/test-contradictory-args.R. Fails onmain(3 failures, 2 errors), passes here. Full suite passes. Docs regenerated with roxygen2 7.3.2.NEWS
Left out to avoid conflicting with #59. Suggested bullet under Bug fixes:
🤖 Generated with Claude Code