Skip to content

Fix spurious toa coercion and Matrix deprecation warnings (1.25.1) - #94

Merged
gvegayon merged 1 commit into
masterfrom
fix-warnings-86-87
Oct 22, 2026
Merged

gvegayon merged 1 commit into
masterfrom
fix-warnings-86-87

Conversation

@gvegayon

Copy link
Copy Markdown
Member

Fixes #86 and #87, the two warnings flagged by the reviewer of the netdiffuseR tutorial paper (Connections).

Changes

  • new_diffnet(): check is.integer(toa) instead of inherits(toa, "integer"). The latter is FALSE for integer matrices (class c("matrix", "array")), so every multi-behavior rdiffnet() call warned "Coercing -toa- into integer." (Warning in TOA coercion when calling multi diffusion model #86)
  • as_dgCMatrix.default(): replace the deprecated as(<dgeMatrix>, "dgCMatrix") with the Matrix-recommended dMatrix -> generalMatrix -> CsparseMatrix chain. This removes the deprecation from exposure(..., alt.graph = "se"). (dgCMatrix is deprecated #87)
  • Regression tests for both; version bumped to 1.25.1; NEWS and CITATION.cff updated.

Verification

  • SE exposure on the Korean Family Planning example is identical() before and after the change.
  • Full testthat suite in 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

* 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>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 03:33
@github-actions

Copy link
Copy Markdown

Version bump check ✅

group base head bump
netdiffuseR 1.25.0 1.25.1 ✅ patch update

Checked 1 group(s) against 1490ceb1979328935bb56e44bfa30750b9aac589 · please-bump

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@gvegayon
gvegayon merged commit 8558472 into master Oct 22, 2026
13 checks passed
@gvegayon
gvegayon deleted the fix-warnings-86-87 branch October 22, 2026 03:52
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.

Warning in TOA coercion when calling multi diffusion model

2 participants