[Python-modules-commits] [python-networkx] 01/13: Import python-networkx_1.11~rc1.orig.tar.gz
Sandro Tosi
morph at moszumanska.debian.org
Sun Jan 3 00:29:28 UTC 2016
This is an automated email from the git hooks/post-receive script.
morph pushed a commit to branch master
in repository python-networkx.
commit 6a408794c7f2665de3e5683bde893bed5397c590
Author: Sandro Tosi <morph at debian.org>
Date: Sat Jan 2 21:35:49 2016 +0000
Import python-networkx_1.11~rc1.orig.tar.gz
---
PKG-INFO | 2 +-
doc/gh-pages.py | 4 +-
doc/requirements.txt | 2 +-
doc/source/bibliography.rst | 12 +-
doc/source/conf.py | 2 +-
doc/source/install.rst | 3 +-
doc/source/reference/api_1.11.rst | 30 +++
doc/source/reference/api_1.5.rst | 2 +-
doc/source/reference/api_1.6.rst | 2 +-
doc/source/reference/api_changes.rst | 1 +
doc/source/reference/classes.digraph.rst | 3 +
doc/source/reference/classes.graph.rst | 4 +
doc/source/reference/classes.multidigraph.rst | 4 +
doc/source/reference/classes.multigraph.rst | 4 +
doc/source/reference/drawing.rst | 1 +
doc/source/reference/news.rst | 100 +++++--
doc/source/templates/gallery.html | 53 ----
examples/drawing/atlas.py | 87 ++++++-
examples/drawing/chess_masters.py | 166 +++++++++++-
examples/drawing/chess_masters_WCC.pgn.bz2 | Bin 39 -> 100224 bytes
examples/drawing/knuth_miles.txt.gz | Bin 27 -> 20317 bytes
examples/drawing/unix_email.mbox | 85 +++++-
networkx.egg-info/PKG-INFO | 2 +-
networkx.egg-info/SOURCES.txt | 2 +-
networkx/algorithms/assortativity/connectivity.py | 7 +-
networkx/algorithms/bipartite/projection.py | 10 +-
networkx/algorithms/centrality/betweenness.py | 4 +-
.../algorithms/centrality/betweenness_subset.py | 4 +-
networkx/algorithms/centrality/eigenvector.py | 4 +-
networkx/algorithms/centrality/harmonic.py | 7 +-
networkx/algorithms/centrality/katz.py | 2 +-
networkx/algorithms/flow/__init__.py | 10 -
networkx/algorithms/flow/capacityscaling.py | 17 +-
networkx/algorithms/flow/mincost.py | 28 +-
networkx/algorithms/flow/networksimplex.py | 13 +-
networkx/algorithms/link_analysis/hits_alg.py | 4 +-
networkx/algorithms/matching.py | 2 +-
networkx/algorithms/mis.py | 2 +-
networkx/algorithms/richclub.py | 2 +-
networkx/algorithms/shortest_paths/weighted.py | 6 +-
networkx/classes/digraph.py | 5 +-
networkx/classes/function.py | 4 +-
networkx/classes/graph.py | 11 +-
networkx/classes/multidigraph.py | 5 +-
networkx/classes/multigraph.py | 15 +-
networkx/drawing/layout.py | 289 +++++++++------------
networkx/drawing/nx_pylab.py | 14 +-
networkx/drawing/tests/test_layout.py | 115 +++++++-
networkx/generators/stochastic.py | 4 +-
networkx/linalg/algebraicconnectivity.py | 2 +-
networkx/readwrite/gml.py | 2 +-
networkx/readwrite/nx_shp.py | 1 +
networkx/release.py | 3 +-
networkx/version.py | 8 +-
54 files changed, 813 insertions(+), 358 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index ed26bd4..55f4c91 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: networkx
-Version: 1.10
+Version: 1.11rc1
Summary: Python package for creating and manipulating graphs and networks
Home-page: http://networkx.github.io/
Author: NetworkX Developers
diff --git a/doc/gh-pages.py b/doc/gh-pages.py
index c0d152e..c510533 100755
--- a/doc/gh-pages.py
+++ b/doc/gh-pages.py
@@ -32,7 +32,7 @@ from subprocess import Popen, PIPE, CalledProcessError, check_call
pages_dir = 'gh-pages'
html_dir = 'build/dist'
pdf_dir = 'build/latex'
-pages_repo = 'git at github.com:networkx/documentation.git'
+pages_repo = 'https://github.com/networkx/documentation.git'
#-----------------------------------------------------------------------------
# Functions
@@ -121,7 +121,7 @@ if __name__ == '__main__':
try:
cd(pages_dir)
status = sh2('git status | head -1')
- branch = re.match('\# On branch (.*)$', status).group(1)
+ branch = re.match('On branch (.*)$', status).group(1)
if branch != 'gh-pages':
e = 'On %r, git branch is %r, MUST be "gh-pages"' % (pages_dir,
branch)
diff --git a/doc/requirements.txt b/doc/requirements.txt
index 7d7fc91..deba1d4 100644
--- a/doc/requirements.txt
+++ b/doc/requirements.txt
@@ -3,6 +3,6 @@ numpy >= 1.6
matplotlib
pandas
pydotplus
-sphinx >= 1.3
+-e git://github.com/sphinx-doc/sphinx.git@stable#egg=Sphinx-origin_stable
sphinxcontrib-bibtex
sphinx_rtd_theme
diff --git a/doc/source/bibliography.rst b/doc/source/bibliography.rst
index 90fde54..3510df5 100644
--- a/doc/source/bibliography.rst
+++ b/doc/source/bibliography.rst
@@ -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.
@@ -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.
@@ -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
@@ -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
diff --git a/doc/source/conf.py b/doc/source/conf.py
index e265348..96ea8ef 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -55,7 +55,7 @@ if on_rtd:
# 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
diff --git a/doc/source/install.rst b/doc/source/install.rst
index d186863..51fa953 100644
--- a/doc/source/install.rst
+++ b/doc/source/install.rst
@@ -59,10 +59,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`
diff --git a/doc/source/reference/api_1.11.rst b/doc/source/reference/api_1.11.rst
new file mode 100644
index 0000000..b45a2ea
--- /dev/null
+++ b/doc/source/reference/api_1.11.rst
@@ -0,0 +1,30 @@
+**********************************
+Version 1.11 notes and API changes
+**********************************
+
+This page includes more detailed release information and API changes from
+NetworkX 1.10 to NetworkX 1.11.
+
+Please send comments and questions to the networkx-discuss mailing list:
+<http://groups.google.com/group/networkx-discuss>.
+
+API changes
+-----------
+
+* [`#1750 <https://github.com/networkx/networkx/pull/1750>`_]
+ Arguments center and scale are now available for all layout functions.
+ The defaul values revert to the v1.9 values (center is the origin
+ for circular layouts and domain is [0, scale) for others.
+
+Miscellaneous changes
+---------------------
+
+* [`#1763 <https://github.com/networkx/networkx/pull/1763>`_]
+ Set up appveyor to automatically test installation on Windows machines.
+ Remove symbolic links in examples to help such istallation.
+
+Change many doc_string typos to allow sphinx
+to build the docs without errors or warnings.
+
+Enable the docs to be automatically built on
+readthedocs.org by changing requirements.txt
diff --git a/doc/source/reference/api_1.5.rst b/doc/source/reference/api_1.5.rst
index 04d5b12..ff71226 100644
--- a/doc/source/reference/api_1.5.rst
+++ b/doc/source/reference/api_1.5.rst
@@ -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
diff --git a/doc/source/reference/api_1.6.rst b/doc/source/reference/api_1.6.rst
index f3d6944..d2a130c 100644
--- a/doc/source/reference/api_1.6.rst
+++ b/doc/source/reference/api_1.6.rst
@@ -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:
diff --git a/doc/source/reference/api_changes.rst b/doc/source/reference/api_changes.rst
index 73bfb44..df1d12f 100644
--- a/doc/source/reference/api_changes.rst
+++ b/doc/source/reference/api_changes.rst
@@ -5,6 +5,7 @@ API changes
.. toctree::
:maxdepth: 2
+ api_1.11
api_1.10
api_1.9
api_1.8
diff --git a/doc/source/reference/classes.digraph.rst b/doc/source/reference/classes.digraph.rst
index 655cc34..187a41d 100644
--- a/doc/source/reference/classes.digraph.rst
+++ b/doc/source/reference/classes.digraph.rst
@@ -9,6 +9,9 @@ Overview
.. currentmodule:: networkx
.. autofunction:: DiGraph
+=======
+Methods
+=======
Adding and removing nodes and edges
===================================
diff --git a/doc/source/reference/classes.graph.rst b/doc/source/reference/classes.graph.rst
index 142b0a0..fee3a18 100644
--- a/doc/source/reference/classes.graph.rst
+++ b/doc/source/reference/classes.graph.rst
@@ -9,6 +9,10 @@ Overview
.. currentmodule:: networkx
.. autofunction:: Graph
+=======
+Methods
+=======
+
Adding and removing nodes and edges
===================================
diff --git a/doc/source/reference/classes.multidigraph.rst b/doc/source/reference/classes.multidigraph.rst
index 3fbb71f..e367dc7 100644
--- a/doc/source/reference/classes.multidigraph.rst
+++ b/doc/source/reference/classes.multidigraph.rst
@@ -10,6 +10,10 @@ Overview
.. currentmodule:: networkx
.. autofunction:: MultiDiGraph
+=======
+Methods
+=======
+
Adding and Removing Nodes and Edges
===================================
diff --git a/doc/source/reference/classes.multigraph.rst b/doc/source/reference/classes.multigraph.rst
index ad7b9ac..3a95759 100644
--- a/doc/source/reference/classes.multigraph.rst
+++ b/doc/source/reference/classes.multigraph.rst
@@ -9,6 +9,10 @@ Overview
.. currentmodule:: networkx
.. autofunction:: MultiGraph
+=======
+Methods
+=======
+
Adding and removing nodes and edges
===================================
diff --git a/doc/source/reference/drawing.rst b/doc/source/reference/drawing.rst
index b5a76b7..41f00aa 100644
--- a/doc/source/reference/drawing.rst
+++ b/doc/source/reference/drawing.rst
@@ -78,6 +78,7 @@ Graph Layout
:toctree: generated/
circular_layout
+ fruchterman_reingold_layout
random_layout
shell_layout
spring_layout
diff --git a/doc/source/reference/news.rst b/doc/source/reference/news.rst
index dca7003..2773252 100644
--- a/doc/source/reference/news.rst
+++ b/doc/source/reference/news.rst
@@ -4,20 +4,64 @@
Release Log
===========
-NetworkX 2.0
-------------
-Release date: TBD
+NetworkX 1.11
+-------------
+Release date: * November 2015
+
+Support for Python 3.5 added, drop support for Python 3.2.
+
+Highlights
+~~~~~~~~~~
+Fixes installation on some machines and test with appveyor,
+Restores default center and scale of layout routines,
+Fixes various docs including no symbolic links in examples.
+Docs can now build using autosummary on readthedocs.org.
+
+NetworkX 1.10
+-------------
+Release date: 2 August 2015
Support for Python 2.6 is dropped in this release.
+Highlights
+~~~~~~~~~~
+- Connected components now return generators
+- new functions including
+
+ + 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
+
+- pyparsing dependence removed from GML reader/parser
+- improve flow algorithms
+- new generators releated to expander graphs.
+- new generators for multipartite graphs, nonisomorphic trees,
+ circulant graphs
+- allow graph subclasses to use dict-like objects in place of dicts
+- added ordered graph subclasses
+- pandas dataframe read/write added.
+- data keyword in G.edges() allows requesting edge attribute directly
+- expanded layout flexibility for node subsets
+- Kanesky's algorithm for cut sets and k_components
+- power function for graphs
+- approximation of node connectivity
+- transitive closure, triadic census and antichains
+- quotient graphs and minors
+- longest_path for DAGS
+- modularity matrix routines
+
+API changes
+~~~~~~~~~~~
+See :doc:`api_1.10`.
+
NetworkX 1.9.1
--------------
Release date: 13 September 2014
Bugfix release for minor installation and documentation issues.
-https://github.com/networkx/networkx/milestones/networkx-1.9.1
-
NetworkX 1.9
------------
Release date: 21 June 2014
@@ -153,7 +197,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
@@ -171,21 +216,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
------------
diff --git a/doc/source/templates/gallery.html b/doc/source/templates/gallery.html
deleted file mode 100644
index f4fbd1b..0000000
--- a/doc/source/templates/gallery.html
+++ /dev/null
@@ -1,53 +0,0 @@
-
-{% extends "layout.html" %}
-{% set title = "Gallery" %}
-
-
-{% block body %}
-
-<h3>Click on any image to see source code</h3>
-<br/>
-
-
-<a href="examples/drawing/chess_masters.html"><img src="_static/examples/chess_masters_thumb.png" border="0" alt="chess_masters"/></a>
-
-
-<a href="examples/drawing/degree_histogram.html"><img src="_static/examples/degree_histogram_thumb.png" border="0" alt="degree_histogram"/></a>
-
-
-<a href="examples/drawing/edge_colormap.html"><img src="_static/examples/edge_colormap_thumb.png" border="0" alt="edge_colormap"/></a>
-
-
-<a href="examples/drawing/ego_graph.html"><img src="_static/examples/ego_graph_thumb.png" border="0" alt="ego_graph"/></a>
-
-
-<a href="examples/drawing/four_grids.html"><img src="_static/examples/four_grids_thumb.png" border="0" alt="four_grids"/></a>
-
-
-<a href="examples/drawing/house_with_colors.html"><img src="_static/examples/house_with_colors_thumb.png" border="0" alt="house_with_colors"/></a>
-
-
-<a href="examples/drawing/knuth_miles.html"><img src="_static/examples/knuth_miles_thumb.png" border="0" alt="knuth_miles"/></a>
-
-
-<a href="examples/drawing/labels_and_colors.html"><img src="_static/examples/labels_and_colors_thumb.png" border="0" alt="labels_and_colors"/></a>
-
-
-<a href="examples/drawing/node_colormap.html"><img src="_static/examples/node_colormap_thumb.png" border="0" alt="node_colormap"/></a>
-
-
-<a href="examples/drawing/random_geometric_graph.html"><img src="_static/examples/random_geometric_graph_thumb.png" border="0" alt="random_geometric_graph"/></a>
-
-
-<a href="examples/drawing/sampson.html"><img src="_static/examples/sampson_thumb.png" border="0" alt="sampson"/></a>
-
-
-<a href="examples/drawing/simple_path.html"><img src="_static/examples/simple_path_thumb.png" border="0" alt="simple_path"/></a>
-
-
-<a href="examples/drawing/unix_email.html"><img src="_static/examples/unix_email_thumb.png" border="0" alt="unix_email"/></a>
-
-
-<a href="examples/drawing/weighted_graph.html"><img src="_static/examples/weighted_graph_thumb.png" border="0" alt="weighted_graph"/></a>
-
-{% endblock %}
diff --git a/examples/drawing/atlas.py b/examples/drawing/atlas.py
deleted file mode 120000
index 4af3f3a..0000000
--- a/examples/drawing/atlas.py
+++ /dev/null
@@ -1 +0,0 @@
-../graph/atlas.py
\ No newline at end of file
diff --git a/examples/drawing/atlas.py b/examples/drawing/atlas.py
new file mode 100644
index 0000000..ce55efa
--- /dev/null
+++ b/examples/drawing/atlas.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python
+"""
+Atlas of all graphs of 6 nodes or less.
+
+"""
+__author__ = """Aric Hagberg (hagberg at lanl.gov)"""
+# Copyright (C) 2004 by
+# Aric Hagberg <hagberg at lanl.gov>
+# Dan Schult <dschult at colgate.edu>
+# Pieter Swart <swart at lanl.gov>
+# All rights reserved.
+# BSD license.
+
+import networkx as nx
+from networkx.generators.atlas import *
+from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic as isomorphic
+import random
+
+def atlas6():
+ """ Return the atlas of all connected graphs of 6 nodes or less.
+ Attempt to check for isomorphisms and remove.
+ """
+
+ Atlas=graph_atlas_g()[0:208] # 208
+ # remove isolated nodes, only connected graphs are left
+ U=nx.Graph() # graph for union of all graphs in atlas
+ for G in Atlas:
+ zerodegree=[n for n in G if G.degree(n)==0]
+ for n in zerodegree:
+ G.remove_node(n)
+ U=nx.disjoint_union(U,G)
+
+ # list of graphs of all connected components
+ C=nx.connected_component_subgraphs(U)
+
+ UU=nx.Graph()
+ # do quick isomorphic-like check, not a true isomorphism checker
+ nlist=[] # list of nonisomorphic graphs
+ for G in C:
+ # check against all nonisomorphic graphs so far
+ if not iso(G,nlist):
+ nlist.append(G)
+ UU=nx.disjoint_union(UU,G) # union the nonisomorphic graphs
+ return UU
+
+def iso(G1, glist):
+ """Quick and dirty nonisomorphism checker used to check isomorphisms."""
+ for G2 in glist:
+ if isomorphic(G1,G2):
+ return True
+ return False
+
+
+if __name__ == '__main__':
+
+ import networkx as nx
+
+ G=atlas6()
+
+ print("graph has %d nodes with %d edges"\
+ %(nx.number_of_nodes(G),nx.number_of_edges(G)))
+ print(nx.number_connected_components(G),"connected components")
+
+
+ try:
+ from networkx import graphviz_layout
+ except ImportError:
+ raise ImportError("This example needs Graphviz and either PyGraphviz or Pydot")
+
+ import matplotlib.pyplot as plt
+ plt.figure(1,figsize=(8,8))
+ # layout graphs with positions using graphviz neato
+ pos=nx.graphviz_layout(G,prog="neato")
+ # color nodes the same in each connected subgraph
+ C=nx.connected_component_subgraphs(G)
+ for g in C:
+ c=[random.random()]*nx.number_of_nodes(g) # random color...
+ nx.draw(g,
+ pos,
+ node_size=40,
+ node_color=c,
+ vmin=0.0,
+ vmax=1.0,
+ with_labels=False
+ )
+ plt.savefig("atlas.png",dpi=75)
diff --git a/examples/drawing/chess_masters.py b/examples/drawing/chess_masters.py
deleted file mode 120000
index 57d42d0..0000000
--- a/examples/drawing/chess_masters.py
+++ /dev/null
@@ -1 +0,0 @@
-../multigraph/chess_masters.py
\ No newline at end of file
diff --git a/examples/drawing/chess_masters.py b/examples/drawing/chess_masters.py
new file mode 100644
index 0000000..fe8e2d1
--- /dev/null
+++ b/examples/drawing/chess_masters.py
@@ -0,0 +1,165 @@
+#!/usr/bin/env python
+
+"""
+An example of the MultiDiGraph clas
+
+The function chess_pgn_graph reads a collection of chess
+matches stored in the specified PGN file
+(PGN ="Portable Game Notation")
+Here the (compressed) default file ---
+ chess_masters_WCC.pgn.bz2 ---
+contains all 685 World Chess Championship matches
+from 1886 - 1985.
+(data from http://chessproblem.my-free-games.com/chess/games/Download-PGN.php)
+
+The chess_pgn_graph() function returns a MultiDiGraph
+with multiple edges. Each node is
+the last name of a chess master. Each edge is directed
+from white to black and contains selected game info.
+
+The key statement in chess_pgn_graph below is
+ G.add_edge(white, black, game_info)
+where game_info is a dict describing each game.
+
+"""
+# Copyright (C) 2006-2010 by
+# Aric Hagberg <hagberg at lanl.gov>
+# Dan Schult <dschult at colgate.edu>
+# Pieter Swart <swart at lanl.gov>
+# All rights reserved.
+# BSD license.
+
+import networkx as nx
+
+# tag names specifying what game info should be
+# stored in the dict on each digraph edge
+game_details=["Event",
+ "Date",
+ "Result",
+ "ECO",
+ "Site"]
+
+def chess_pgn_graph(pgn_file="chess_masters_WCC.pgn.bz2"):
+ """Read chess games in pgn format in pgn_file.
+
+ Filenames ending in .gz or .bz2 will be uncompressed.
+
+ Return the MultiDiGraph of players connected by a chess game.
+ Edges contain game data in a dict.
+
+ """
+ import bz2
+ G=nx.MultiDiGraph()
+ game={}
+ datafile = bz2.BZ2File(pgn_file)
+ lines = (line.decode().rstrip('\r\n') for line in datafile)
+ for line in lines:
+ if line.startswith('['):
+ tag,value=line[1:-1].split(' ',1)
+ game[str(tag)]=value.strip('"')
+ else:
+ # empty line after tag set indicates
+ # we finished reading game info
+ if game:
+ white=game.pop('White')
+ black=game.pop('Black')
+ G.add_edge(white, black, **game)
+ game={}
+ return G
+
+
+if __name__ == '__main__':
+ import networkx as nx
+
+
+ G=chess_pgn_graph()
+
+ ngames=G.number_of_edges()
+ nplayers=G.number_of_nodes()
+
+ print("Loaded %d chess games between %d players\n"\
+ % (ngames,nplayers))
+
+ # identify connected components
+ # of the undirected version
+ Gcc=list(nx.connected_component_subgraphs(G.to_undirected()))
+ if len(Gcc)>1:
+ print("Note the disconnected component consisting of:")
+ print(Gcc[1].nodes())
+
+ # find all games with B97 opening (as described in ECO)
+ openings=set([game_info['ECO']
+ for (white,black,game_info) in G.edges(data=True)])
+ print("\nFrom a total of %d different openings,"%len(openings))
+ print('the following games used the Sicilian opening')
+ print('with the Najdorff 7...Qb6 "Poisoned Pawn" variation.\n')
+
+ for (white,black,game_info) in G.edges(data=True):
+ if game_info['ECO']=='B97':
+ print(white,"vs",black)
+ for k,v in game_info.items():
+ print(" ",k,": ",v)
+ print("\n")
+
+
+ try:
+ import matplotlib.pyplot as plt
+ except ImportError:
+ import sys
+ print("Matplotlib needed for drawing. Skipping")
+ sys.exit(0)
+
+ # make new undirected graph H without multi-edges
+ H=nx.Graph(G)
+
+ # edge width is proportional number of games played
+ edgewidth=[]
+ for (u,v,d) in H.edges(data=True):
+ edgewidth.append(len(G.get_edge_data(u,v)))
+
+ # node size is proportional to number of games won
+ wins=dict.fromkeys(G.nodes(),0.0)
+ for (u,v,d) in G.edges(data=True):
+ r=d['Result'].split('-')
+ if r[0]=='1':
+ wins[u]+=1.0
+ elif r[0]=='1/2':
+ wins[u]+=0.5
+ wins[v]+=0.5
+ else:
+ wins[v]+=1.0
+ try:
+ pos=nx.graphviz_layout(H)
+ except:
+ pos=nx.spring_layout(H,iterations=20)
+
+ plt.rcParams['text.usetex'] = False
+ plt.figure(figsize=(8,8))
+ nx.draw_networkx_edges(H,pos,alpha=0.3,width=edgewidth, edge_color='m')
+ nodesize=[wins[v]*50 for v in H]
+ nx.draw_networkx_nodes(H,pos,node_size=nodesize,node_color='w',alpha=0.4)
+ nx.draw_networkx_edges(H,pos,alpha=0.4,node_size=0,width=1,edge_color='k')
+ nx.draw_networkx_labels(H,pos,fontsize=14)
+ font = {'fontname' : 'Helvetica',
+ 'color' : 'k',
+ 'fontweight' : 'bold',
+ 'fontsize' : 14}
+ plt.title("World Chess Championship Games: 1886 - 1985", font)
+
+ # change font and write text (using data coordinates)
+ font = {'fontname' : 'Helvetica',
+ 'color' : 'r',
+ 'fontweight' : 'bold',
+ 'fontsize' : 14}
+
+ plt.text(0.5, 0.97, "edge width = # games played",
+ horizontalalignment='center',
+ transform=plt.gca().transAxes)
+ plt.text(0.5, 0.94, "node size = # games won",
+ horizontalalignment='center',
+ transform=plt.gca().transAxes)
+
+ plt.axis('off')
+ plt.savefig("chess_masters.png",dpi=75)
+ print("Wrote chess_masters.png")
+ plt.show() # display
diff --git a/examples/drawing/chess_masters_WCC.pgn.bz2 b/examples/drawing/chess_masters_WCC.pgn.bz2
deleted file mode 120000
index 2d84241..0000000
--- a/examples/drawing/chess_masters_WCC.pgn.bz2
+++ /dev/null
@@ -1 +0,0 @@
-../multigraph/chess_masters_WCC.pgn.bz2
\ No newline at end of file
diff --git a/examples/drawing/chess_masters_WCC.pgn.bz2 b/examples/drawing/chess_masters_WCC.pgn.bz2
new file mode 100644
index 0000000..3761ce5
Binary files /dev/null and b/examples/drawing/chess_masters_WCC.pgn.bz2 differ
diff --git a/examples/drawing/knuth_miles.txt.gz b/examples/drawing/knuth_miles.txt.gz
deleted file mode 120000
index 046582a..0000000
--- a/examples/drawing/knuth_miles.txt.gz
+++ /dev/null
@@ -1 +0,0 @@
-../graph/knuth_miles.txt.gz
\ No newline at end of file
diff --git a/examples/drawing/knuth_miles.txt.gz b/examples/drawing/knuth_miles.txt.gz
new file mode 100644
index 0000000..62b7f95
Binary files /dev/null and b/examples/drawing/knuth_miles.txt.gz differ
diff --git a/examples/drawing/unix_email.mbox b/examples/drawing/unix_email.mbox
deleted file mode 120000
index a7d59f3..0000000
--- a/examples/drawing/unix_email.mbox
+++ /dev/null
@@ -1 +0,0 @@
-../graph/unix_email.mbox
\ No newline at end of file
diff --git a/examples/drawing/unix_email.mbox b/examples/drawing/unix_email.mbox
new file mode 100644
index 0000000..a3a7cf8
--- /dev/null
+++ b/examples/drawing/unix_email.mbox
@@ -0,0 +1,84 @@
+From alice at edu Thu Jun 16 16:12:12 2005
+From: Alice <alice at edu>
+Subject: NetworkX
+Date: Thu, 16 Jun 2005 16:12:13 -0700
+To: Bob <bob at gov>
+Status: RO
+Content-Length: 86
+Lines: 5
+
+Bob, check out the new networkx release - you and
+Carol might really like it.
+
+Alice
+
+
+From bob at gov Thu Jun 16 18:13:12 2005
+Return-Path: <bob at gov>
+Subject: Re: NetworkX
+From: Bob <bob at gov>
+To: Alice <alice at edu>
+Content-Type: text/plain
+Date: Thu, 16 Jun 2005 18:13:12 -0700
+Status: RO
+Content-Length: 26
+Lines: 4
+
+Thanks for the tip.
+
+Bob
+
+
+From ted at com Thu Jul 28 09:53:31 2005
+Return-Path: <ted at com>
+Subject: Graph package in Python?
+From: Ted <ted at com>
+To: Bob <bob at gov>
+Content-Type: text/plain
+Date: Thu, 28 Jul 2005 09:47:03 -0700
+Status: RO
+Content-Length: 90
+Lines: 3
+
+Hey Ted - I'm looking for a Python package for
+graphs and networks. Do you know of any?
+
+
+From bob at gov Thu Jul 28 09:59:31 2005
+Return-Path: <bob at gov>
+Subject: Re: Graph package in Python?
+From: Bob <bob at gov>
+To: Ted <ted at com>
+Content-Type: text/plain
+Date: Thu, 28 Jul 2005 09:59:03 -0700
+Status: RO
+Content-Length: 180
+Lines: 9
+
+
+Check out the NetworkX package - Alice sent me the tip!
+
+Bob
+
+>> bob at gov scrawled:
+>> Hey Ted - I'm looking for a Python package for
+>> graphs and networks. Do you know of any?
+
+
+From ted at com Thu Jul 28 15:53:31 2005
+Return-Path: <ted at com>
+Subject: get together for lunch to discuss Networks?
+From: Ted <ted at com>
+To: Bob <bob at gov>, Carol <carol at gov>, Alice <alice at edu>
+Content-Type: text/plain
+Date: Thu, 28 Jul 2005 15:47:03 -0700
+Status: RO
+Content-Length: 139
+Lines: 5
+
+Hey everyrone! Want to meet at that restaurant on the
+island in Konigsburg tonight? Bring your laptops
+and we can install NetworkX.
+
+Ted
+
diff --git a/networkx.egg-info/PKG-INFO b/networkx.egg-info/PKG-INFO
index ed26bd4..55f4c91 100644
--- a/networkx.egg-info/PKG-INFO
+++ b/networkx.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: networkx
-Version: 1.10
+Version: 1.11rc1
Summary: Python package for creating and manipulating graphs and networks
Home-page: http://networkx.github.io/
Author: NetworkX Developers
diff --git a/networkx.egg-info/SOURCES.txt b/networkx.egg-info/SOURCES.txt
index 61aff04..8907dad 100644
--- a/networkx.egg-info/SOURCES.txt
+++ b/networkx.egg-info/SOURCES.txt
@@ -88,6 +88,7 @@ doc/source/reference/algorithms.vitality.rst
doc/source/reference/api_0.99.rst
doc/source/reference/api_1.0.rst
doc/source/reference/api_1.10.rst
+doc/source/reference/api_1.11.rst
doc/source/reference/api_1.4.rst
doc/source/reference/api_1.5.rst
doc/source/reference/api_1.6.rst
@@ -135,7 +136,6 @@ doc/source/static/art1.png
doc/source/static/networkx.css
doc/source/static/trac.css
doc/source/static/force/force.css
-doc/source/templates/gallery.html
doc/source/templates/index.html
doc/source/templates/indexsidebar.html
doc/source/templates/layout.html
diff --git a/networkx/algorithms/assortativity/connectivity.py b/networkx/algorithms/assortativity/connectivity.py
index b852174..f368379 100644
--- a/networkx/algorithms/assortativity/connectivity.py
+++ b/networkx/algorithms/assortativity/connectivity.py
@@ -49,13 +49,12 @@ def average_degree_connectivity(G, source="in+out", target="in+out",
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`.
@@ -70,7 +69,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.
@@ -80,7 +79,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
diff --git a/networkx/algorithms/bipartite/projection.py b/networkx/algorithms/bipartite/projection.py
index 7f08244..2bb0770 100644
--- a/networkx/algorithms/bipartite/projection.py
+++ b/networkx/algorithms/bipartite/projection.py
... 1569 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-networkx.git
More information about the Python-modules-commits
mailing list