From 49e69775c99cd49f7613bbf9604c1902a9baf958 Mon Sep 17 00:00:00 2001 From: Nicholas Landry Date: Sat, 7 Sep 2024 22:47:26 -0400 Subject: [PATCH] add references --- xgi/algorithms/simpliciality.py | 26 +++++++++++- xgi/stats/nodestats.py | 75 +++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/xgi/algorithms/simpliciality.py b/xgi/algorithms/simpliciality.py index 4d2650b6..96cc5b5a 100644 --- a/xgi/algorithms/simpliciality.py +++ b/xgi/algorithms/simpliciality.py @@ -36,6 +36,12 @@ def edit_simpliciality(H, min_size=2, exclude_min_size=True): ------- float The edit simpliciality + + References + ---------- + "The simpliciality of higher-order order networks" + by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier, + *EPJ Data Science* **13**, 17 (2024). """ edges = H.edges.filterby("size", min_size, "geq").members() @@ -100,6 +106,12 @@ def simplicial_edit_distance(H, min_size=2, exclude_min_size=True, normalize=Tru ------- float The edit simpliciality + + References + ---------- + "The simpliciality of higher-order order networks" + by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier, + *EPJ Data Science* **13**, 17 (2024). """ edges = H.edges.filterby("size", min_size, "geq").members() @@ -165,6 +177,12 @@ def face_edit_simpliciality(H, min_size=2, exclude_min_size=True): ------- float The face edit simpliciality + + References + ---------- + "The simpliciality of higher-order order networks" + by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier, + *EPJ Data Science* **13**, 17 (2024). """ edges = ( H.edges.maximal().filterby("size", min_size + exclude_min_size, "geq").members() @@ -210,7 +228,7 @@ def mean_face_edit_distance(H, min_size=2, exclude_min_size=True, normalize=True ---------- "The simpliciality of higher-order order networks" by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier, - *EPJ Data Science* **13**, 17 (2024) + *EPJ Data Science* **13**, 17 (2024). """ t = Trie() t.build_trie(H.edges.filterby("size", min_size, "geq").members()) @@ -248,6 +266,12 @@ def simplicial_fraction(H, min_size=2, exclude_min_size=True): ------- float The simplicial fraction + + References + ---------- + "The simpliciality of higher-order order networks" + by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier, + *EPJ Data Science* **13**, 17 (2024). """ try: ns = _count_simplices(H, min_size, exclude_min_size) diff --git a/xgi/stats/nodestats.py b/xgi/stats/nodestats.py index 559f4bcf..b09a871e 100644 --- a/xgi/stats/nodestats.py +++ b/xgi/stats/nodestats.py @@ -496,6 +496,31 @@ def katz_centrality(net, bunch, cutoff=100): def local_simplicial_fraction(net, bunch, min_size=2, exclude_min_size=True): + """The local simplicial fraction. + + Parameters + ---------- + net : xgi.Hypergraph + The network. + bunch : Iterable + Nodes in `net`. + min_size: int, default: 2 + The minimum hyperedge size to include when + calculating whether a hyperedge is a simplex + by counting subfaces. + exclude_min_size : bool, optional + Whether to include minimal simplices when counting simplices, by default True + + Returns + ------- + dict + + References + ---------- + "The simpliciality of higher-order order networks" + by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier, + *EPJ Data Science* **13**, 17 (2024). + """ s = dict() for n in bunch: nbrs = net.nodes.neighbors(n) @@ -509,6 +534,31 @@ def local_simplicial_fraction(net, bunch, min_size=2, exclude_min_size=True): def local_edit_simpliciality(net, bunch, min_size=2, exclude_min_size=True): + """The local edit simpliciality. + + Parameters + ---------- + net : xgi.Hypergraph + The network. + bunch : Iterable + Nodes in `net`. + min_size: int, default: 2 + The minimum hyperedge size to include when + calculating whether a hyperedge is a simplex + by counting subfaces. + exclude_min_size : bool, optional + Whether to include minimal simplices when counting simplices, by default True + + Returns + ------- + dict + + References + ---------- + "The simpliciality of higher-order order networks" + by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier, + *EPJ Data Science* **13**, 17 (2024). + """ s = dict() for n in bunch: nbrs = net.nodes.neighbors(n) @@ -522,6 +572,31 @@ def local_edit_simpliciality(net, bunch, min_size=2, exclude_min_size=True): def local_face_edit_simpliciality(net, bunch, min_size=2, exclude_min_size=True): + """The local face edit simpliciality. + + Parameters + ---------- + net : xgi.Hypergraph + The network. + bunch : Iterable + Nodes in `net`. + min_size: int, default: 2 + The minimum hyperedge size to include when + calculating whether a hyperedge is a simplex + by counting subfaces. + exclude_min_size : bool, optional + Whether to include minimal simplices when counting simplices, by default True + + Returns + ------- + dict + + References + ---------- + "The simpliciality of higher-order order networks" + by Nicholas Landry, Jean-Gabriel Young, and Nicole Eikmeier, + *EPJ Data Science* **13**, 17 (2024). + """ s = dict() for n in bunch: nbrs = net.nodes.neighbors(n)