Skip to content

v1.7.0#122

Merged
jhollway merged 25 commits intomainfrom
develop
Nov 19, 2025
Merged

v1.7.0#122
jhollway merged 25 commits intomainfrom
develop

Conversation

@jhollway
Copy link
Collaborator

@jhollway jhollway commented Nov 6, 2025

Description

Making

  • Improved vector printing to be more succinct and suggest print_all()
  • Improved printing methods for changing mnet objects

Modifying

  • Added delete_changes() for deleting all changes from a changing network
  • Improved to_waves() to work with networks that are changing, longitudinal, or both
  • Fixed as_diffusion() to not trim off final wave in the report
  • Fixed as_diffusion() to return correct E and R compartments for waning diffusion models

Marking

  • Improved is_longitudinal() to only check for tie waves and not nodal changes

Measuring

  • Improved net_diversity() and node_diversity()
    • No longer offers a cluster option, which can be obtained using over_membership()
    • Added more methods for calculating diversity, including Teachman's, coefficient of variation, and the Gini coefficient
    • Improved net_diversity() and node_diversity() to use and declare methods appropriate for the vector of attributes
  • Added net_homophily() and node_homophily() for measuring homophily according to different methods including
    • Krackhardt's EI index of heterophily as well as its inverse as a measure of homophily
    • Yule's Q as a further measure of homophily
    • Geary's C as a measure of homophily for numeric attributes
  • Updated documentation for richness, diversity, and homophily measures
  • Fixed node_is_latent(), node_is_infected(), node_is_recoverd() to work with changing networks
  • Improved node_is_exposed() to work with changing networks and now accepts a time argument

Tutorials

  • Fixed description of to_directed() and to_redirected() in the data tutorial

Checklist:

  • Documentation
    • DESCRIPTION file version is bumped by the appropriate increment (major, minor, patch)
    • Date in DESCRIPTION is correct
    • Longer functions are commented inline or broken down into helper functions to help debugging
  • PR form
    • Title indicates expected version number
    • PR description above and the NEWS.md file are aligned
    • Description above itemizes changes under subsection titles, e.g. "## Data""
    • Closed, fixed, or related issues are referenced and explained in the description above, e.g. "Fixed #0 by adding A"

@jhollway jhollway self-assigned this Nov 6, 2025
@jhollway jhollway requested a review from RWKrause November 6, 2025 20:16
@jhollway
Copy link
Collaborator Author

jhollway commented Nov 6, 2025

@RWKrause , re #115 I've made a first run at a broader net_homophily() function that incorporates Krackhardt's EI/IE index, Yule's Q, Geary's C, etc. Still to do include:

  • broader testing/coverage
  • missing data treatment
  • ensure defaults/reporting are sensible
  • any additional measures to implement while we're at it? maybe incorporate degree assortativity (net_assortativity()) and/or Moran's I (net_spatial())?
  • update the diversity tutorial in {migraph} to make use of these new functions/functionalities

@RWKrause
Copy link

RWKrause commented Nov 6, 2025

Hey
AWESOME ♥ I would add assortativity, but not by degree but as a function that requires an attribute, so that you can give it the degree but also a numeric attribute.
Cheers
Robert

@jhollway
Copy link
Collaborator Author

jhollway commented Nov 7, 2025

Ok, @RWKrause , do you want to propose a generalised assortativity function, and/or implement a clever way to manage missing data across these and other functions? I'll implement them for two-mode networks, and update the tutorials?

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

❌ Patch coverage is 32.08333% with 163 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.74%. Comparing base (faddeb7) to head (44508be).
⚠️ Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
R/measure_heterogeneity.R 16.19% 88 Missing ⚠️
R/manip_split.R 20.31% 51 Missing ⚠️
R/mark_nodes.R 64.58% 17 Missing ⚠️
R/class_networks.R 0.00% 3 Missing ⚠️
R/manip_as.R 84.61% 2 Missing ⚠️
R/class_models.R 0.00% 1 Missing ⚠️
R/manip_nodes.R 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #122      +/-   ##
==========================================
- Coverage   58.80%   56.74%   -2.06%     
==========================================
  Files          45       45              
  Lines        5734     5912     +178     
==========================================
- Hits         3372     3355      -17     
- Misses       2362     2557     +195     

☔ View full report in Codecov by Sentry.
📢 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 changed the title v1.6.8 v1.7.0 Nov 19, 2025
@jhollway jhollway merged commit c83ba7f into main Nov 19, 2025
3 of 4 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