Repository: networkx/networkx

Issue:
`geometric_edges` should be accessible
<!-- If you have a general question about NetworkX, please use the discussions tab to create a new discussion -->

<!--- Provide a general summary of the issue in the Title above -->
The function `geometric_edges` in `generators.geometric` is not callable.   However, I have found a case where someone wants to use it (more specifically is asking for a function that does it).  https://stackoverflow.com/q/68815295/2966723 

I thought I'd just build an example for the person, but I can't figure out how to call it, presumably because it isn't in `__all__`, but I'm not an expert on this.

### Current Behavior
I get an error that the function doesn't exist.

### Expected Behavior
I'd like the function to run.

### Steps to Reproduce

    import networkx as nx
    import random 
    pos = {n: (random.random(), random.random()) for n in range(100)}
    G= nx.Graph()
    G.add_nodes_from(pos)
    radius = 0.1 #connect nodes of distance <0.1
    G.add_edges_from(nx.generators.geometric.geometric_edges(G, radius,2))
    > AttributeError: module 'networkx.generators.geometric' has no attribute 'geometric_edges'

### Environment
<!--- Please provide details about your local environment -->
Python version: 3.7(?)
NetworkX version: 2.4


### Additional context
<!--- Add any other context about the problem here, screenshots, etc. -->



Discussion:
The function is available in NetworkX 2.6.2.  I haven't tracked down which version it became available.
The calling name is just as you expected:  `nx.generators.geometric.geometric_edges`

But I think it makes sense to publish this function to the public interface so that `nx.geometric_edges` would work.

Resolving patch:
diff --git a/networkx/generators/geometric.py b/networkx/generators/geometric.py
--- a/networkx/generators/geometric.py
+++ b/networkx/generators/geometric.py
@@ -10,12 +10,13 @@
 from networkx.utils import nodes_or_number, py_random_state
 
 __all__ = [
+    "geometric_edges",
     "geographical_threshold_graph",
-    "waxman_graph",
     "navigable_small_world_graph",
     "random_geometric_graph",
     "soft_random_geometric_graph",
     "thresholded_random_geometric_graph",
+    "waxman_graph",
 ]
 
 
@@ -30,10 +31,52 @@ def euclidean(x, y):
 
 
 def geometric_edges(G, radius, p):
-    """Returns edge list of node pairs within `radius` of each other
+    """Returns edge list of node pairs within `radius` of each other.
 
+    Parameters
+    ----------
+    G : networkx graph
+        The graph from which to generate the edge list. The nodes in `G` should
+        have an attribute ``pos`` corresponding to the node position, which is
+        used to compute the distance to other nodes.
+    radius : scalar
+        The distance threshold. Edges are included in the edge list if the
+        distance between the two nodes is less than `radius`.
+    p : scalar
+        The `Minkowski distance metric
+        <https://en.wikipedia.org/wiki/Minkowski_distance>`_ use to compute
+        distances.
+
+    Returns
+    -------
+    edges : list
+        List of edges whose distances are less than `radius`
+
+    Notes
+    -----
     Radius uses Minkowski distance metric `p`.
-    If scipy available, use scipy cKDTree to speed computation.
+    If scipy is available, `scipy.spatial.cKDTree` is used to speed computation.
+
+    Examples
+    --------
+    Create a graph with nodes that have a "pos" attribute representing 2D
+    coordinates.
+
+    >>> G = nx.Graph()
+    >>> G.add_nodes_from([
+    ...     (0, {"pos": (0, 0)}),
+    ...     (1, {"pos": (3, 0)}),
+    ...     (2, {"pos": (8, 0)}),
+    ... ])
+    >>> p = 2  # Euclidean distance
+    >>> nx.geometric_edges(G, radius=1, p=p)
+    []
+    >>> nx.geometric_edges(G, radius=4, p=p)
+    [(0, 1)]
+    >>> nx.geometric_edges(G, radius=6, p=p)
+    [(0, 1), (1, 2)]
+    >>> nx.geometric_edges(G, radius=9, p=p)
+    [(0, 1), (0, 2), (1, 2)]
     """
     nodes_pos = G.nodes(data="pos")
     try:


Test patch: