Skip to content

v1.0.3 - #36

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

v1.0.3#36
jhollway merged 4 commits into
mainfrom
develop

Conversation

@jhollway

@jhollway jhollway commented Sep 9, 2026

Copy link
Copy Markdown
Member

Measures

  • Fixed two node_by_homophily() issues
    • It was reading a vector attribute against the wrong nodes
    • It was reporting the E-I index where it computed Geary's C
  • Fixed net_by_homophily() discarding tie weights before Geary's C
    • Geary's C now declares that on a weighted network, it can exceed 2
  • Fixed net_by_spatial() erroring on a two-mode network
    • For one-mode attributes, projection is used
    • For multimodal attributes, the multilevel matrix is read instead
  • Fixed net_by_spatial() propogating missing values
  • Fixed net_by_diversity() and node_by_diversity() erroring on a factor attribute

Memberships

  • Fixed two node_in_leiden() issues
    • It was returning a community for every node on an unweighted network
    • It was overriding a user's resolution
  • Fixed node_in_community(), node_in_spinglass() and node_in_fluid()
    treating a weakly connected directed network as unconnected
  • Fixed node_in_partition() returning a split it had already improved upon
    • Added start= for a random rather than a node-order initialisation

Copilot AI lite review requested due to automatic review settings September 9, 2026 14:50

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 changes are well-covered by new/updated tests and only a minor release-note typo remains.

Pull request overview

Updates netrics to v1.0.3 with targeted correctness fixes across heterogeneity measures (homophily/spatial/diversity) and community membership algorithms, aligning computation, metadata, and documentation with intended behavior.

Changes:

  • Fixes Moran’s I (net_by_spatial()) for two-mode networks (projection vs multilevel), missing attributes, and zero-variance/empty-edge cases.
  • Fixes homophily (net_by_homophily(), node_by_homophily()) to correctly handle Geary’s C (including weighted ties) and attribute handling within ego subgraphs.
  • Fixes/extends community memberships: node_in_partition() stability (best-pass retention) + new start= option; Leiden default resolution=NULL (density-based) and weak-connectivity eligibility for algorithms that treat graphs as undirected.
File summaries
File Description
tests/testthat/test-member_community.R Adds/updates regression tests for partition stability, random starts, Leiden resolution defaults, and weak connectivity handling.
tests/testthat/test-measure_heterogeneity.R Adds regression tests for two-mode spatial autocorrelation routing, missing-value handling, Geary’s C labeling/weights, and factor diversity fallback.
R/member_community.R Implements weak-connectivity gating, improves Kernighan–Lin pass behavior, adds start= to node_in_partition(), and updates Leiden default resolution behavior.
R/measure_heterogeneity.R Updates homophily handling (Geary’s C weights + correct ego attribute mapping), enhances net_by_spatial() for two-mode + missing values, and broadens categorical detection for diversity.
NEWS.md Adds v1.0.3 release notes.
man/member_community_non.Rd Documents node_in_partition(start=) and Leiden resolution=NULL default semantics.
man/measure_diverse_net.Rd Documents HHI relationship to Blau’s index and adds citation.
man/measure_assort_node.Rd Documents weighted Geary’s C upper range behavior.
man/measure_assort_net.Rd Documents weighted Geary’s C upper range behavior and expanded spatial autocorrelation behavior notes.
DESCRIPTION Bumps package version to 1.0.3.
Review details

Files not reviewed (4)

  • man/measure_assort_net.Rd: Generated file
  • man/measure_assort_node.Rd: Generated file
  • man/measure_diverse_net.Rd: Generated file
  • man/member_community_non.Rd: Generated file
  • Files reviewed: 6/10 changed files
  • Comments generated: 1
  • 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 thread NEWS.md Outdated
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.63014% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.15%. Comparing base (a24ddea) to head (8748f1b).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
R/member_community.R 96.96% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
+ Coverage   89.25%   90.15%   +0.90%     
==========================================
  Files          30       30              
  Lines        3620     3657      +37     
==========================================
+ Hits         3231     3297      +66     
+ Misses        389      360      -29     

☔ 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 37ff2e9 into main Sep 9, 2026
5 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

Development

Successfully merging this pull request may close these issues.

2 participants