Repository navigation
Fix spurious toa coercion and Matrix deprecation warnings (1.25.1) - #94
Merged
Merged
Conversation
* new_diffnet() checks the storage mode of toa (is.integer) rather than its class, which failed for integer matrices in multi-behavior runs. * as_dgCMatrix.default() uses the dMatrix -> generalMatrix -> CsparseMatrix coercion chain instead of the deprecated as(<dgeMatrix>, "dgCMatrix"). * Adds regression tests and bumps version to 1.25.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Version bump check ✅
Checked 1 group(s) against |
There was a problem hiding this comment.
🟢 Approval recommended
The focused fixes address both reported warnings, include targeted regression coverage, and have no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes the two warning paths reported in #86 and #87 and prepares netdiffuseR 1.25.1.
Changes:
- Checks integer storage directly to avoid spurious time-of-adoption coercion warnings in multi-behavior simulations.
- Replaces deprecated Matrix coercion with the recommended conversion chain and adds regression tests for both warning paths.
- Updates the package version, citation metadata, and release notes.
| File | Description |
|---|---|
| tests/testthat/test-struct_equiv.R | Tests structural-equivalence exposure without deprecated coercions. |
| tests/testthat/test-rdiffnet.R | Tests warning-free multi-behavior simulation and integer adoption times. |
| R/misc.r | Uses the supported Matrix coercion chain. |
| R/diffnet-class.r | Uses is.integer() to check adoption-time storage. |
| NEWS.md | Documents both warning fixes. |
| DESCRIPTION | Bumps the package version to 1.25.1. |
| CITATION.cff | Updates citation version metadata to 1.25.1. |
Review effort: Balanced
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.
Fixes #86 and #87, the two warnings flagged by the reviewer of the netdiffuseR tutorial paper (Connections).
Changes
new_diffnet(): checkis.integer(toa)instead ofinherits(toa, "integer"). The latter is FALSE for integer matrices (classc("matrix", "array")), so every multi-behaviorrdiffnet()call warned "Coercing -toa- into integer." (Warning in TOA coercion when calling multi diffusion model #86)as_dgCMatrix.default(): replace the deprecatedas(<dgeMatrix>, "dgCMatrix")with the Matrix-recommendeddMatrix->generalMatrix->CsparseMatrixchain. This removes the deprecation fromexposure(..., alt.graph = "se"). (dgCMatrix is deprecated #87)Verification
identical()before and after the change.rocker r-ver:4.5(R 4.5.3, Matrix 1.7.4): master 0 failed / 580 passed; this branch 0 failed / 583 passed, and suite warnings drop from 59 to 40.🤖 Generated with Claude Code