Skip to content

Commit

Permalink
Fix some sphinx formatting errors
Browse files Browse the repository at this point in the history
    make all doc_strings raw format r''' '''
    correct underline lengths for headings
    fix latex issue in harmonic_centrality
    replace 🎫, :url:, :doi:, :arxiv:  with links to webpages
    fix spacing with commas before colons so sphinx can parse well
    add "methods" heading in graph class rst files
  • Loading branch information
dschult committed Oct 4, 2015
1 parent 578aff0 commit fdbf0ef
Show file tree
Hide file tree
Showing 38 changed files with 161 additions and 122 deletions.
12 changes: 6 additions & 6 deletions doc/source/bibliography.rst
Expand Up @@ -5,7 +5,7 @@ Bibliography

.. [BA02] R. Albert and A.-L. Barabási, "Statistical mechanics of complex
networks", Reviews of Modern Physics, 74, pp. 47-97, 2002.
:arxiv:`cond-mat/0106096`
http://arxiv.org/abs/cond-mat/0106096
.. [Bollobas01] B. Bollobás, "Random Graphs", Second Edition,
Cambridge University Press, 2001.
Expand All @@ -19,17 +19,17 @@ Bibliography
.. [choudum1986] S.A. Choudum. "A simple proof of the Erdős-Gallai theorem on
graph sequences." Bulletin of the Australian Mathematical Society, 33,
pp 67-70, 1986. :doi:`10.1017/S0004972700002872`
pp 67-70, 1986. http://dx.doi.org/10.1017/S0004972700002872
.. [Diestel97] R. Diestel, "Graph Theory", Springer-Verlag, 1997.
:url:`http://diestel-graph-theory.com/index.html`
http://diestel-graph-theory.com/index.html
.. [DM03] S.N. Dorogovtsev and J.F.F. Mendes, "Evolution of Networks",
Oxford University Press, 2003.
.. [EppsteinPads] David Eppstein.
PADS, A library of Python Algorithms and Data Structures.
:url:`http://www.ics.uci.edu/~eppstein/PADS`
http://www.ics.uci.edu/~eppstein/PADS
.. [EG1960] Erdős and Gallai, Mat. Lapok 11 264, 1960.
Expand All @@ -48,7 +48,7 @@ Bibliography
.. [Newman03] M.E.J. Newman, "The Structure and Function of Complex
Networks", SIAM Review, 45, pp. 167-256, 2003.
:url:`http://epubs.siam.org/doi/abs/10.1137/S003614450342480`
http://epubs.siam.org/doi/abs/10.1137/S003614450342480
.. [Sedgewick02] R. Sedgewick, "Algorithms in C: Parts 1-4:
Fundamentals, Data Structure, Sorting, Searching", Addison Wesley
Expand All @@ -61,5 +61,5 @@ Bibliography
2nd ed., 2001.
.. [vanRossum98] Guido van Rossum. Python Patterns - Implementing Graphs, 1998.
:url:`http://www.python.org/doc/essays/graphs`
http://www.python.org/doc/essays/graphs
2 changes: 1 addition & 1 deletion doc/source/conf.py
Expand Up @@ -55,7 +55,7 @@ def cd(newpath):
# from networkx/doc/source (which holds conf.py).
py = sys.executable
subprocess.call([py, 'make_gallery.py'])
subprocess.call([py, 'make_examples.py', '../examples', 'source'])
subprocess.call([py, 'make_examples_rst.py', '../examples', 'source'])

# If your extensions are in another directory, add it here.
# These locations are relative to conf.py
Expand Down
4 changes: 2 additions & 2 deletions doc/source/install.rst
Expand Up @@ -74,11 +74,11 @@ GitHub
------

1. Clone the networkx repostitory
::
(see https://github.com/networkx/networkx/ for options)
::

git clone https://github.com/networkx/networkx.git

(see https://github.com/networkx/networkx/ for other options)

2. Change directory to :samp:`networkx`

Expand Down
1 change: 0 additions & 1 deletion doc/source/reference/algorithms.rst
Expand Up @@ -41,7 +41,6 @@ Algorithms
algorithms.matching
algorithms.minors
algorithms.mis
algorithms.mst
algorithms.operators
algorithms.rich_club
algorithms.shortest_paths
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/api_1.5.rst
Expand Up @@ -12,7 +12,7 @@ Weighted graph algorithms

Many 'weighted' graph algorithms now take optional parameter to
specifiy which edge attribute should be used for the weight
(default='weight') (:ticket:`509`)
(default='weight') (ticket https://networkx.lanl.gov/trac/ticket/509)

In some cases the parameter name was changed from weighted_edges,
or weighted, to weight. Here is how to specify which edge attribute
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/api_1.6.rst
Expand Up @@ -21,7 +21,7 @@ Weighted graph algorithms

Many 'weighted' graph algorithms now take optional parameter to
specifiy which edge attribute should be used for the weight
(default='weight') (:ticket:`573`)
(default='weight') (ticket https://networkx.lanl.gov/trac/ticket/573)

In some cases the parameter name was changed from weighted, to weight. Here is
how to specify which edge attribute will be used in the algorithms:
Expand Down
3 changes: 3 additions & 0 deletions doc/source/reference/classes.digraph.rst
Expand Up @@ -9,6 +9,9 @@ Overview
.. currentmodule:: networkx
.. autofunction:: DiGraph

=======
Methods
=======

Adding and removing nodes and edges
===================================
Expand Down
4 changes: 4 additions & 0 deletions doc/source/reference/classes.graph.rst
Expand Up @@ -9,6 +9,10 @@ Overview
.. currentmodule:: networkx
.. autofunction:: Graph

=======
Methods
=======

Adding and removing nodes and edges
===================================

Expand Down
4 changes: 4 additions & 0 deletions doc/source/reference/classes.multidigraph.rst
Expand Up @@ -10,6 +10,10 @@ Overview
.. currentmodule:: networkx
.. autofunction:: MultiDiGraph

=======
Methods
=======

Adding and Removing Nodes and Edges
===================================

Expand Down
4 changes: 4 additions & 0 deletions doc/source/reference/classes.multigraph.rst
Expand Up @@ -9,6 +9,10 @@ Overview
.. currentmodule:: networkx
.. autofunction:: MultiGraph

=======
Methods
=======

Adding and removing nodes and edges
===================================

Expand Down
2 changes: 0 additions & 2 deletions doc/source/reference/functions.rst
Expand Up @@ -24,7 +24,6 @@ Nodes

nodes
number_of_nodes
nodes_iter
all_neighbors
non_neighbors
common_neighbors
Expand All @@ -38,7 +37,6 @@ Edges

edges
number_of_edges
edges_iter
non_edges


Expand Down
60 changes: 40 additions & 20 deletions doc/source/reference/news.rst
Expand Up @@ -8,6 +8,10 @@ NetworkX 2.0
------------
Release date: TBD

.. toctree::

migration_guide_from_1.x_to_2.0

NetworkX 1.10
--------------
Release date: 2 August 2015
Expand All @@ -18,11 +22,13 @@ Highlights
~~~~~~~~~~
- Connected components now return generators
- new functions including
- enumerate_all_cliques, greedy_coloring, edge_dfs, find_cycle

+ enumerate_all_cliques, greedy_coloring, edge_dfs, find_cycle
immediate_dominators, harmonic_centrality
- Hopcraft--Karp algorithm for maximum matchings
- optimum branchings and arborescences.
- all_simple_paths
+ Hopcraft--Karp algorithm for maximum matchings
+ optimum branchings and arborescences.
+ all_simple_paths

- pyparsing dependence removed from GML reader/parser
- improve flow algorithms
- new generators releated to expander graphs.
Expand Down Expand Up @@ -188,7 +194,8 @@ New features
that handle subsets of nodes
- :mod:`In-place node relabeling <networkx.relabel>`
- Many 'weighted' graph algorithms now take optional parameter to use
specified edge attribute (default='weight') (:ticket:`509`)
specified edge attribute (default='weight')
(ticket https://networkx.lanl.gov/trac/ticket/509)

- Test for :mod:`distance regular <networkx.algorithms.distance_regular>` graphs
- Fast :mod:`directed Erdős-Renyi graph <networkx.generators.random_graphs>` generator
Expand All @@ -206,21 +213,34 @@ See :doc:`api_1.5`

Bug fixes
~~~~~~~~~
- Fix edge handling for multigraphs in networkx/graphviz interface
(:ticket:`507`)
- Update networkx/pydot interface for new versions of pydot
(:ticket:`506`), (:ticket:`535`)
- Fix negative cycle handling in Bellman-Ford (:ticket:`502`)
- Write more attributes with GraphML and GML formats (:ticket:`480`)
- Handle white space better in read_edgelist (:ticket:`513`)
- Better parsing of Pajek format files (:ticket:`524`) (:ticket:`542`)
- Isolates functions work with directed graphs (:ticket:`526`)
- Faster conversion to numpy matrices (:ticket:`529`)
- Add graph['name'] and use properties to access Graph.name (:ticket:`544`)
- Topological sort confused None and 0 (:ticket:`546`)
- GEXF writer mishandled weight=0 (:ticket:`550`)
- Speedup in SciPy version of PageRank (:ticket:`554`)
- Numpy PageRank node order incorrect + speedups (:ticket:`555`)
- Fix edge handling for multigraphs in networkx/graphviz interface
(ticket https://networkx.lanl.gov/trac/ticket/507)
- Update networkx/pydot interface for new versions of pydot
(ticket https://networkx.lanl.gov/trac/ticket/506)
(ticket https://networkx.lanl.gov/trac/ticket/535)
- Fix negative cycle handling in Bellman-Ford
(ticket https://networkx.lanl.gov/trac/ticket/502)
- Write more attributes with GraphML and GML formats
(ticket https://networkx.lanl.gov/trac/ticket/480)
- Handle white space better in read_edgelist
(ticket https://networkx.lanl.gov/trac/ticket/513)
- Better parsing of Pajek format files
(ticket https://networkx.lanl.gov/trac/ticket/524)
(ticket https://networkx.lanl.gov/trac/ticket/542)
- Isolates functions work with directed graphs
(ticket https://networkx.lanl.gov/trac/ticket/526)
- Faster conversion to numpy matrices
(ticket https://networkx.lanl.gov/trac/ticket/529)
- Add graph['name'] and use properties to access Graph.name
(ticket https://networkx.lanl.gov/trac/ticket/544)
- Topological sort confused None and 0
(ticket https://networkx.lanl.gov/trac/ticket/546)
- GEXF writer mishandled weight=0
(ticket https://networkx.lanl.gov/trac/ticket/550)
- Speedup in SciPy version of PageRank
(ticket https://networkx.lanl.gov/trac/ticket/554)
- Numpy PageRank node order incorrect + speedups
(ticket https://networkx.lanl.gov/trac/ticket/555)

NetworkX 1.4
------------
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/release_2.0.rst
Expand Up @@ -11,7 +11,7 @@ Please send comments and questions to the networkx-discuss [mailing list](http:/

API changes
-----------
* [`<>`_]
* Base Graph Class Changes
With the release of NetworkX 2.0 we are moving towards an iterator reporting API.
We used to have two methods for the same property of the graph, one that returns a
list and one that returns an iterator. With 2.0 we have removed the one that returns
Expand Down
9 changes: 4 additions & 5 deletions networkx/algorithms/assortativity/connectivity.py
Expand Up @@ -48,18 +48,17 @@ def _avg_deg_conn(G, neighbors, source_degree, target_degree,

def average_degree_connectivity(G, source="in+out", target="in+out",
nodes=None, weight=None):
"""Compute the average degree connectivity of graph.
r"""Compute the average degree connectivity of graph.
The average degree connectivity is the average nearest neighbor degree of
nodes with degree k. For weighted graphs, an analogous measure can
be computed using the weighted average neighbors degree defined in
[1]_, for a node `i`, as:
[1]_, for a node `i`, as
.. math::
k_{nn,i}^{w} = \frac{1}{s_i} \sum_{j \in N(i)} w_{ij} k_j
where `s_i` is the weighted degree of node `i`,
`w_{ij}` is the weight of the edge that links `i` and `j`,
and `N(i)` are the neighbors of node `i`.
Expand All @@ -74,7 +73,7 @@ def average_degree_connectivity(G, source="in+out", target="in+out",
target : "in"|"out"|"in+out" (default:"in+out"
Directed graphs only. Use "in"- or "out"-degree for target node.
nodes: list or iterable (optional)
nodes : list or iterable (optional)
Compute neighbor connectivity for these nodes. The default is all
nodes.
Expand All @@ -84,7 +83,7 @@ def average_degree_connectivity(G, source="in+out", target="in+out",
Returns
-------
d: dict
d : dict
A dictionary keyed by degree k with the value of average connectivity.
Examples
Expand Down
10 changes: 5 additions & 5 deletions networkx/algorithms/bipartite/projection.py
Expand Up @@ -63,7 +63,7 @@ def projected_graph(B, nodes, multigraph=False):
[['a', 'b'], ['a', 'b']]
Notes
------
-----
No attempt is made to verify that the input graph B is bipartite.
Returns a simple graph that is the projection of the bipartite graph B
onto the set of nodes given in list nodes. If multigraph=True then
Expand Down Expand Up @@ -158,7 +158,7 @@ def weighted_projected_graph(B, nodes, ratio=False):
[(1, 3, {'weight': 0.5})]
Notes
------
-----
No attempt is made to verify that the input graph B is bipartite.
The graph and node properties are (shallow) copied to the projected graph.
Expand Down Expand Up @@ -252,7 +252,7 @@ def collaboration_weighted_projected_graph(B, nodes):
(2, 5, {'weight': 0.5})
Notes
------
-----
No attempt is made to verify that the input graph B is bipartite.
The graph and node properties are (shallow) copied to the projected graph.
Expand Down Expand Up @@ -344,7 +344,7 @@ def overlap_weighted_projected_graph(B, nodes, jaccard=True):
[(0, 2, {'weight': 1.0}), (2, 4, {'weight': 1.0})]
Notes
------
-----
No attempt is made to verify that the input graph B is bipartite.
The graph and node properties are (shallow) copied to the projected graph.
Expand Down Expand Up @@ -457,7 +457,7 @@ def generic_weighted_projected_graph(B, nodes, weight_function=None):
[(0, 1, {'weight': 10})]
Notes
------
-----
No attempt is made to verify that the input graph B is bipartite.
The graph and node properties are (shallow) copied to the projected graph.
Expand Down
4 changes: 2 additions & 2 deletions networkx/algorithms/centrality/betweenness.py
Expand Up @@ -25,7 +25,7 @@ def betweenness_centrality(G, k=None, normalized=True, weight=None,
r"""Compute the shortest-path betweenness centrality for nodes.
Betweenness centrality of a node `v` is the sum of the
fraction of all-pairs shortest paths that pass through `v`:
fraction of all-pairs shortest paths that pass through `v`
.. math::
Expand Down Expand Up @@ -134,7 +134,7 @@ def edge_betweenness_centrality(G, k=None, normalized=True, weight=None,
r"""Compute betweenness centrality for edges.
Betweenness centrality of an edge `e` is the sum of the
fraction of all-pairs shortest paths that pass through `e`:
fraction of all-pairs shortest paths that pass through `e`
.. math::
Expand Down
4 changes: 2 additions & 2 deletions networkx/algorithms/centrality/betweenness_subset.py
Expand Up @@ -24,7 +24,7 @@
def betweenness_centrality_subset(G,sources,targets,
normalized=False,
weight=None):
"""Compute betweenness centrality for a subset of nodes.
r"""Compute betweenness centrality for a subset of nodes.
.. math::
Expand Down Expand Up @@ -106,7 +106,7 @@ def betweenness_centrality_subset(G,sources,targets,
def edge_betweenness_centrality_subset(G,sources,targets,
normalized=False,
weight=None):
"""Compute betweenness centrality for edges for a subset of nodes.
r"""Compute betweenness centrality for edges for a subset of nodes.
.. math::
Expand Down
4 changes: 2 additions & 2 deletions networkx/algorithms/centrality/eigenvector.py
Expand Up @@ -68,7 +68,7 @@ def eigenvector_centrality(G, max_iter=100, tol=1.0e-6, nstart=None,
hits
Notes
------
-----
The measure was introduced by [1]_ and is discussed in [2]_.
Eigenvector convergence: The power iteration method is used to compute
Expand Down Expand Up @@ -179,7 +179,7 @@ def eigenvector_centrality_numpy(G, weight='weight'):
hits
Notes
------
-----
The measure was introduced by [1]_.
This algorithm uses the SciPy sparse eigenvalue solver (ARPACK) to
Expand Down

0 comments on commit fdbf0ef

Please sign in to comment.