Skip to content

v1.0.2 - #35

Merged
jhollway merged 9 commits into
mainfrom
develop
Sep 4, 2026
Merged

v1.0.2#35
jhollway merged 9 commits into
mainfrom
develop

Conversation

@jhollway

@jhollway jhollway commented Sep 4, 2026

Copy link
Copy Markdown
Member

Package

  • Fixed some warning tests related to changes in snet output in manynet
  • Raised {manynet} floor to 2.3.1, retiring to_ties() and net_waves() shims

Marks

Measures

Memberships

Methods

Copilot AI lite review requested due to automatic review settings September 4, 2026 15:34
@jhollway jhollway self-assigned this Sep 4, 2026

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.

🟡 Changes recommended

Some tests call internal helpers (.to_positive()/.to_unsigned()) unqualified (will fail under R CMD check), and there is also a redundant .to_unsigned() call in net_by_eigenvector().

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Release bump to netrics 1.0.2, focusing on making marks/measures/memberships robust to signed and multilevel network shapes (per stocnet/manynet conventions), adding guardrails for exponential-time cohesion measures, and aligning tests/docs with updated {manynet} behavior.

Changes:

  • Added/updated signed-network handling: distance-based functions drop to positive ties (.to_positive()), while census/structural-style functions read ties by magnitude (.to_unsigned()), with corresponding documentation updates.
  • Improved multilevel handling by avoiding invalid two-mode projections (or stopping with clearer errors where no single-layer ideal applies).
  • Added test coverage for previously failing shapes and introduced limit= guards for net_by_strength() / net_by_toughness() to prevent hangs on larger networks.
File summaries
File Description
tests/testthat/test-shapes.R New regression sweep for signed + multilevel input shapes (node/tie/net/mode).
tests/testthat/test-member_equivalence.R Asserts expected snet warning behavior for degenerate regular equivalence.
tests/testthat/test-member_community.R Updates tests to accept warning/message behavior changes in snet output.
tests/testthat/test-measure_nodes.R Adjusts node-measure sweep to account for signed eccentricity guard + eigenvector warnings.
tests/testthat/test-measure_net.R Muffles expected eigenvector warnings in net-measure sweep.
tests/testthat/test-measure_heterogeneity.R Adds test that net_by_spatial() errors clearly on non-numeric attributes.
tests/testthat/test-measure_cohesion.R Adds tests for limit= guard behavior on exponential measures.
tests/testthat/test-mark_ties.R Adds tests for tie_is_max/min() numeric vectors + improved argument errors.
tests/testthat/helper-netrics.R Adds helpers to normalize snet warn/abort signaling across {manynet} versions.
R/netrics-utils.R Removes retired compatibility shims; adds .to_unsigned() helper; keeps .to_positive() and .is_multilevel().
R/motif_census.R Applies .to_positive() for node_x_path() on signed networks + documents behavior.
R/method_coreness.R Treats multilevel networks as one-mode (avoids incorrect two-mode handling).
R/member_community.R Restricts signed networks to spinglass; adds clearer “no algorithm available” abort path; avoids node_in_optimal() shortcut when signed.
R/measure_holes.R Avoids projection for multilevel networks in structural hole measures.
R/measure_hierarchy.R Applies .to_positive() for signed networks and documents rationale.
R/measure_heterogeneity.R Replaces stopifnot(is.numeric) with clear snet_abort() message for net_by_spatial().
R/measure_features.R Stops net_by_core/factions() on multilevel networks; applies .to_unsigned() for signed modularity.
R/measure_cohesion.R Adds .check_enumerable() and limit= param to guard exponential-time measures; updates examples to use fict_greys.
R/measure_change.R Drops .net_waves() shim and relies on {manynet} floor behavior.
R/measure_centrality_eigen.R Reads signed ties by magnitude for eigen-family; treats multilevel as non-projectable; removes retired to_ties() shim usage.
R/measure_centrality_degree.R Replaces retired .to_linegraph() shim with manynet::to_linegraph().
R/measure_centrality_closeness.R Applies .to_positive() for signed distance-based centrality/centralization functions + docs.
R/measure_centrality_between.R Applies .to_positive() for signed betweenness centrality/centralization; uses .to_unsigned() for tie betweenness.
R/mark_ties.R Improves tie_is_path() missing-arg error; applies .to_unsigned() for signed triangle marks; adds input-type guard for tie_is_max/min().
R/mark_nodes.R Applies .to_positive() for node_is_fold(); avoids projection for multilevel node_is_independent(); adds signed/multilevel docs.
NEWS.md Adds release notes for 1.0.2.
man/motif_path.Rd Documents signed-network behavior for node_x_path().
man/method_coreness.Rd Documents multilevel-network behavior for coreness methods.
man/member_community.Rd Documents signed-network behavior/limitations for node_in_community().
man/measure_hierarchy.Rd Documents signed-network behavior for hierarchy measures.
man/measure_fragmentation.Rd Documents limit= and enumeration cost; updates examples.
man/measure_fit.Rd Documents signed modularity magnitude-reading; multilevel stops for core/factions.
man/measure_centralisation_close.Rd Documents signed-network behavior for closeness centralization.
man/measure_centralisation_between.Rd Documents signed-network behavior for betweenness centralization.
man/measure_central_tie_between.Rd Documents signed-network magnitude-reading for tie betweenness.
man/measure_central_eigen.Rd Documents signed magnitude-reading + multilevel non-projection for eigen measures.
man/measure_central_close.Rd Documents signed-network behavior for closeness centrality.
man/measure_central_between.Rd Documents signed-network behavior for betweenness centrality.
man/measure_broker_node.Rd Documents multilevel non-projection behavior for broker node measures.
man/mark_triangles.Rd Documents signed-network behavior for triangle marks.
man/mark_select_tie.Rd Documents tie_is_max/min() accepting numeric vectors.
man/mark_nodes.Rd Documents signed + multilevel behavior for node marks touched here.
DESCRIPTION Bumps version to 1.0.2 and raises {manynet} dependency floor to 2.3.1.
.github/CONTRIBUTING.md Extends “Input shapes” guidance, including .to_unsigned() convention for signed networks.
Review details

Files not reviewed (11)

  • man/mark_nodes.Rd: Generated file
  • man/mark_select_tie.Rd: Generated file
  • man/mark_triangles.Rd: Generated file
  • man/measure_broker_node.Rd: Generated file
  • man/measure_central_between.Rd: Generated file
  • man/measure_central_close.Rd: Generated file
  • man/measure_central_eigen.Rd: Generated file
  • man/measure_central_tie_between.Rd: Generated file
  • man/measure_centralisation_between.Rd: Generated file
  • man/measure_centralisation_close.Rd: Generated file
  • man/measure_fit.Rd: Generated file

Suppressed comments (1)

tests/testthat/test-shapes.R:102

  • These calls to .to_positive() / .to_unsigned() are unqualified internal helpers, which won’t be visible when tests run against an installed build. Qualify them with netrics::: (or retrieve from the namespace) so the test file works in R CMD check.
  • Files reviewed: 33/44 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +27 to +29
} else if(grepl("eccentricity", fn) &&
!manynet::is_connected(.to_positive(data_objs[[ob]]))){
# An eccentricity is the distance to the furthest node, which is not
Comment on lines +90 to +92
test_that(".to_positive() and .to_unsigned() each keep every node", {
pos <- .to_positive(signed_multilevel)
uns <- .to_unsigned(signed_multilevel)
Comment thread R/measure_centrality_eigen.R Outdated
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.00990% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.25%. Comparing base (3431769) to head (a24ddea).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
R/netrics-utils.R 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   88.67%   89.25%   +0.57%     
==========================================
  Files          30       30              
  Lines        3533     3620      +87     
==========================================
+ Hits         3133     3231      +98     
+ Misses        400      389      -11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jhollway
jhollway merged commit e5b55e3 into main Sep 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants