From 612447bd909183188b173b99a7c02d900577e359 Mon Sep 17 00:00:00 2001 From: Nicholas Landry Date: Fri, 6 Sep 2024 16:35:49 -0400 Subject: [PATCH] Fix broken "See Also" links --- xgi/algorithms/properties.py | 2 +- xgi/convert/bipartite_edges.py | 4 ++-- xgi/convert/higher_order_network.py | 2 +- xgi/convert/hyperedges.py | 9 ++++++++- xgi/convert/hypergraph_dict.py | 8 +++++++- xgi/convert/incidence.py | 4 ++-- xgi/core/dihypergraph.py | 10 +++++++--- xgi/core/hypergraph.py | 11 ++++++++--- xgi/core/views.py | 2 +- xgi/generators/uniform.py | 2 +- xgi/stats/diedgestats.py | 2 +- xgi/stats/dinodestats.py | 2 +- xgi/stats/edgestats.py | 2 +- xgi/stats/nodestats.py | 2 +- xgi/utils/utilities.py | 6 +++--- 15 files changed, 45 insertions(+), 23 deletions(-) diff --git a/xgi/algorithms/properties.py b/xgi/algorithms/properties.py index ed8571bd4..3cade80f3 100644 --- a/xgi/algorithms/properties.py +++ b/xgi/algorithms/properties.py @@ -152,7 +152,7 @@ def edge_neighborhood(H, n, include_self=False): See Also -------- - neighbors + ~xgi.core.views.IDView.neighbors Examples -------- diff --git a/xgi/convert/bipartite_edges.py b/xgi/convert/bipartite_edges.py index cfb729e74..9050a363e 100644 --- a/xgi/convert/bipartite_edges.py +++ b/xgi/convert/bipartite_edges.py @@ -21,7 +21,7 @@ def from_bipartite_edgelist(edges): See Also -------- - to_hyperedge_list + ~xgi.convert.edgelist.from_hyperedge_list """ if len(edges[0]) == 3: # directed H = DiHypergraph() @@ -55,7 +55,7 @@ def to_bipartite_edgelist(H): See Also -------- - from_hyperedge_list + ~xgi.convert.edgelist.to_hyperedge_list """ if isinstance(H, DiHypergraph): edgelist = [] diff --git a/xgi/convert/higher_order_network.py b/xgi/convert/higher_order_network.py index 7231348f8..271fcc666 100644 --- a/xgi/convert/higher_order_network.py +++ b/xgi/convert/higher_order_network.py @@ -58,7 +58,7 @@ def to_hypergraph(data, create_using=None): See Also -------- - from_max_simplices : Constructs a hypergraph from the maximal simplices of a simplicial complex. + ~xgi.utils.utilities.from_max_simplices : Constructs a hypergraph from the maximal simplices of a simplicial complex. """ if data is None: diff --git a/xgi/convert/hyperedges.py b/xgi/convert/hyperedges.py index e954c024d..d41d682ca 100644 --- a/xgi/convert/hyperedges.py +++ b/xgi/convert/hyperedges.py @@ -30,7 +30,8 @@ def from_hyperedge_dict(d, create_using=None): See Also -------- to_hyperedge_dict - + from_hyperedge_list + to_hyperedge_list """ H = empty_hypergraph(create_using) H.add_edges_from((members, uid) for uid, members in d.items()) @@ -54,6 +55,8 @@ def to_hyperedge_dict(H): See Also -------- from_hyperedge_dict + to_hyperedge_list + from_hyperedge_list """ return H.edges.members(dtype=dict) @@ -76,6 +79,8 @@ def from_hyperedge_list(d, create_using=None, max_order=None): See Also -------- to_hyperedge_list + from_hyperedge_dict + to_hyperedge_dict """ H = empty_hypergraph(create_using) if isinstance(H, SimplicialComplex): @@ -101,5 +106,7 @@ def to_hyperedge_list(H): See Also -------- from_hyperedge_list + to_hyperedge_dict + from_hyperedge_dict """ return H.edges.members() diff --git a/xgi/convert/hypergraph_dict.py b/xgi/convert/hypergraph_dict.py index 22882aaf4..c44b5e083 100644 --- a/xgi/convert/hypergraph_dict.py +++ b/xgi/convert/hypergraph_dict.py @@ -28,6 +28,11 @@ def to_hypergraph_dict(H): If node IDs will be collapsed when casting to a string. XGIError If edge Ids will be collapsed when casting to a string. + + See Also + -------- + ~xgi.readwrite.json.read_json + ~xgi.readwrite.json.write_json """ data = {} data["type"] = get_network_type(H) @@ -94,7 +99,8 @@ def from_hypergraph_dict(data, nodetype=None, edgetype=None, max_order=None): See Also -------- - read_json + ~xgi.readwrite.json.read_json + ~xgi.readwrite.json.write_json """ H = empty_hypergraph() diff --git a/xgi/convert/incidence.py b/xgi/convert/incidence.py index c9728a49c..3c294b7a4 100644 --- a/xgi/convert/incidence.py +++ b/xgi/convert/incidence.py @@ -37,7 +37,7 @@ def from_incidence_matrix(d, create_using=None, nodelabels=None, edgelabels=None See Also -------- - incidence_matrix + ~xgi.linalg.hypergraph_matrix.incidence_matrix to_incidence_matrix """ I = coo_array(d) @@ -92,7 +92,7 @@ def to_incidence_matrix(H, sparse=True, index=False): See Also -------- - incidence_matrix + ~xgi.linalg.hypergraph_matrix.incidence_matrix from_incidence_matrix """ return incidence_matrix(H, sparse=sparse, index=index) diff --git a/xgi/core/dihypergraph.py b/xgi/core/dihypergraph.py index 22e78a0a8..c9dc04bca 100644 --- a/xgi/core/dihypergraph.py +++ b/xgi/core/dihypergraph.py @@ -52,6 +52,10 @@ class DiHypergraph: **attr : dict, optional, default: None Attributes to add to the hypergraph as key, value pairs. + See Also + -------- + ~xgi.core.hypergraph.Hypergraph + Notes ----- Unique IDs are assigned to each node and edge internally and are used to refer to @@ -145,10 +149,10 @@ def __init__(self, incoming_data=None, **attr): self._edge_attr = self._edge_attr_dict_factory() self._nodeview = DiNodeView(self) - """A :class:`~xgi.core.direportviews.DiNodeView` of the directed hypergraph.""" + """A :class:`~xgi.core.views.DiNodeView` of the directed hypergraph.""" self._edgeview = DiEdgeView(self) - """An :class:`~xgi.core.direportviews.DiEdgeView` of the directed hypergraph.""" + """An :class:`~xgi.core.views.DiEdgeView` of the directed hypergraph.""" if incoming_data is not None: # This import needs to happen when this function is called, not when it is @@ -1043,7 +1047,7 @@ def freeze(self): See Also -------- - frozen : Method that raises an error when a user tries to modify the hypergraph + ~xgi.exception.frozen : Method that raises an error when a user tries to modify the hypergraph is_frozen : Check whether a dihypergraph is frozen Examples diff --git a/xgi/core/hypergraph.py b/xgi/core/hypergraph.py index bb8a46fef..134e77257 100644 --- a/xgi/core/hypergraph.py +++ b/xgi/core/hypergraph.py @@ -44,6 +44,11 @@ class Hypergraph: Attributes to add to the hypergraph as key, value pairs. By default, None. + See Also + -------- + ~xgi.core.simplicialcomplex.SimplicialComplex + ~xgi.core.dihypergraph.DiHypergraph + Notes ----- Unique IDs are assigned to each node and edge internally and are used to refer to @@ -128,10 +133,10 @@ def __init__(self, incoming_data=None, **attr): self._edge_attr = self._edge_attr_dict_factory() self._nodeview = NodeView(self) - """A :class:`~xgi.core.reportviews.NodeView` of the hypergraph.""" + """A :class:`~xgi.core.views.NodeView` of the hypergraph.""" self._edgeview = EdgeView(self) - """An :class:`~xgi.core.reportviews.EdgeView` of the hypergraph.""" + """An :class:`~xgi.core.views.EdgeView` of the hypergraph.""" if incoming_data is not None: # This import needs to happen when this function is called, not when it is @@ -1490,7 +1495,7 @@ def freeze(self): See Also -------- - frozen : Method that raises an error when a user tries to modify the hypergraph + ~xgi.exception.frozen : Method that raises an error when a user tries to modify the hypergraph is_frozen : Check whether a hypergraph is frozen Examples diff --git a/xgi/core/views.py b/xgi/core/views.py index 78c578b67..2cb2f8479 100644 --- a/xgi/core/views.py +++ b/xgi/core/views.py @@ -362,7 +362,7 @@ def neighbors(self, id, s=1): See Also -------- - ~xgi.core.function.edge_neighborhood + ~xgi.algorithms.properties.edge_neighborhood Examples -------- diff --git a/xgi/generators/uniform.py b/xgi/generators/uniform.py index d467be778..c010e8ad9 100644 --- a/xgi/generators/uniform.py +++ b/xgi/generators/uniform.py @@ -289,7 +289,7 @@ def uniform_erdos_renyi_hypergraph(n, m, p, p_type="degree", seed=None): See Also -------- - random_hypergraph + ~xgi.generators.random.random_hypergraph """ if seed is not None: np.random.seed(seed) diff --git a/xgi/stats/diedgestats.py b/xgi/stats/diedgestats.py index 8d25cadee..a7b117953 100644 --- a/xgi/stats/diedgestats.py +++ b/xgi/stats/diedgestats.py @@ -3,7 +3,7 @@ This module is part of the stats package, and it defines edge-level statistics. That is, each function defined in this module is assumed to define an edge-quantity mapping. Each callable defined here is accessible via a `Network` object, or a -:class:`~xgi.core.reportviews.DiEdgeView` object. For more details, see the `tutorial +:class:`~xgi.core.views.DiEdgeView` object. For more details, see the `tutorial `_. Examples diff --git a/xgi/stats/dinodestats.py b/xgi/stats/dinodestats.py index a939f2ee9..503afa4eb 100644 --- a/xgi/stats/dinodestats.py +++ b/xgi/stats/dinodestats.py @@ -3,7 +3,7 @@ This module is part of the stats package, and it defines node-level statistics. That is, each function defined in this module is assumed to define a node-quantity mapping. Each callable defined here is accessible via a `Network` object, or a -:class:`~xgi.core.reportviews.NodeView` object. For more details, see the `tutorial +:class:`~xgi.core.views.NodeView` object. For more details, see the `tutorial `_. Examples diff --git a/xgi/stats/edgestats.py b/xgi/stats/edgestats.py index a762e091a..c2c182273 100644 --- a/xgi/stats/edgestats.py +++ b/xgi/stats/edgestats.py @@ -3,7 +3,7 @@ This module is part of the stats package, and it defines edge-level statistics. That is, each function defined in this module is assumed to define an edge-quantity mapping. Each callable defined here is accessible via a `Network` object, or a -:class:`~xgi.core.reportviews.EdgeView` object. For more details, see the `tutorial +:class:`~xgi.core.views.EdgeView` object. For more details, see the `tutorial `_. Examples diff --git a/xgi/stats/nodestats.py b/xgi/stats/nodestats.py index d95381fc3..a1fc91fc9 100644 --- a/xgi/stats/nodestats.py +++ b/xgi/stats/nodestats.py @@ -3,7 +3,7 @@ This module is part of the stats package, and it defines node-level statistics. That is, each function defined in this module is assumed to define a node-quantity mapping. Each callable defined here is accessible via a `Network` object, or a -:class:`~xgi.core.reportviews.NodeView` object. For more details, see the `tutorial +:class:`~xgi.core.views.NodeView` object. For more details, see the `tutorial `_. Examples diff --git a/xgi/utils/utilities.py b/xgi/utils/utilities.py index bea303471..6a9621267 100644 --- a/xgi/utils/utilities.py +++ b/xgi/utils/utilities.py @@ -453,9 +453,9 @@ def hist(vals, bins=10, bin_edges=False, density=False, log_binning=False): Parameters ---------- - vals : Numpy array + vals : numpy.ndarray The array of values - bins : int, list, or Numpy array + bins : int, list, or numpy.ndarray The number of bins or the bin edges. By default, 10. bin_edges : bool @@ -470,7 +470,7 @@ def hist(vals, bins=10, bin_edges=False, density=False, log_binning=False): Returns ------- - Pandas DataFrame + ~pandas.DataFrame A two-column table with "bin_center" and "value" columns, where "value" is a count or a probability. If `bin_edges` is True, outputs two additional columns, `bin_lo` and `bin_hi`,