#5934: [with spkg; needs review] networkx -- fix bad spkg
--------------------------+-------------------------------------------------
 Reporter:  was           |       Owner:  rlm     
     Type:  defect        |      Status:  new     
 Priority:  blocker       |   Milestone:  sage-4.0
Component:  graph theory  |    Keywords:          
--------------------------+-------------------------------------------------

Comment(by mvngu):

 REFEREE REPORT
 [[BR]][[BR]]
 The results of #4860 were due to bad refereeing on my part.
 [[BR]][[BR]]
 The current version of NetworkX in Sage 3.4.2 is, as stated, actually
 version 0.36 instead of 0.99 as claimed by the spkg name in
 SAGE_ROOT/spkg/standard. Version 0.35.1 has a demo/toy/testing
 implementation of {{{edge_betweenness}}}, whereas version 0.36 has an
 actual working implementation. Furthermore, version 0.36 doesn't have the
 module {{{networkx/matching.py}}}, which was introduced in 0.37. Also,
 0.99 has a lot of stuff under {{{networkx/algorithms}}}, whereas 0.36
 doesn't even have such a directory. So with the current actual version
 0.36 as shipped with Sage 3.4.2, the following is expected:
 {{{
 sage: # version 0.36 has a working edge_centrality for the first time
 sage: from networkx import *
 sage: G = Graph()
 sage: G.add_node(1)
 sage: G.add_nodes_from([2,3])
 sage: H=path_graph(10)
 sage: G.add_nodes_from(H)
 sage: G.add_node(H)
 sage: G.add_edge( (1,2) )
 sage: G.add_edges_from([(1,2),(1,3)])
 sage: G.add_edges_from(H.edges())
 sage: networkx.centrality.edge_betweenness(G)

 {(0, 1): 0.25,
  (1, 2): 0.055555555555555552,
  (1, 3): 0.38888888888888884,
  (2, 3): 0.19444444444444442,
  (3, 4): 0.66666666666666663,
  (4, 5): 0.69444444444444442,
  (5, 6): 0.66666666666666663,
  (6, 7): 0.58333333333333326,
  (7, 8): 0.44444444444444442,
  (8, 9): 0.25}
 sage:
 sage: # networkx.algorithms.* not in version 0.36, but appears in version
 0.99
 sage: from networkx.algorithms.isomorphism.isomorph import
 graph_could_be_isomorphic as isomorphic
 ---------------------------------------------------------------------------
 ImportError                               Traceback (most recent call
 last)

 
/home/mvngu/.sage/temp/sage.math.washington.edu/8026/_home_mvngu__sage_init_sage_0.py
 in <module>()

 ImportError: No module named algorithms.isomorphism.isomorph
 sage:
 sage: # version 0.36 doesn't have networkx.matching, which appears for the
 first time in 0.37
 sage: import networkx.matching
 ---------------------------------------------------------------------------
 ImportError                               Traceback (most recent call
 last)

 
/home/mvngu/.sage/temp/sage.math.washington.edu/8026/_home_mvngu__sage_init_sage_0.py
 in <module>()

 ImportError: No module named matching
 }}}
 [[BR]]
 After installing the fake spkg {{{0.99.p1}}} with
 [[BR]][[BR]]
 sage -i
 http://wstein.org/home/wstein/patches/networkx-0.99.p1-fake_really-0.36.spkg
 [[BR]][[BR]]
 and rebuilding with {{{sage -b}}}, I ran all tests on {{{sage/graphs}}}
 with the options {{{-t -long}}} and the tests passed. Running the same
 commands as above that use NetworkX returned similar results:
 {{{
 # version 0.36 has a working edge_centrality for the first time
 sage: from networkx import *
 sage: G = Graph()
 sage: G.add_node(1)
 sage: G.add_nodes_from([2,3])
 sage: H=path_graph(10)
 sage: G.add_nodes_from(H)
 sage: G.add_node(H)
 sage: G.add_edge( (1,2) )
 sage: G.add_edges_from([(1,2),(1,3)])
 sage: G.add_edges_from(H.edges())
 sage: networkx.centrality.edge_betweenness(G)

 {(0, 1): 0.25,
  (1, 2): 0.055555555555555552,
  (1, 3): 0.38888888888888884,
  (2, 3): 0.19444444444444442,
  (3, 4): 0.66666666666666663,
  (4, 5): 0.69444444444444442,
  (5, 6): 0.66666666666666663,
  (6, 7): 0.58333333333333326,
  (7, 8): 0.44444444444444442,
  (8, 9): 0.25}
 sage:
 sage: # networkx.algorithms.* not in version 0.36, but appears in version
 0.99
 sage: from networkx.algorithms.isomorphism.isomorph import
 graph_could_be_isomorphic as isomorphic
 ---------------------------------------------------------------------------
 ImportError                               Traceback (most recent call
 last)

 
/home/mvngu/.sage/temp/sage.math.washington.edu/22888/_home_mvngu__sage_init_sage_0.py
 in <module>()

 ImportError: No module named algorithms.isomorphism.isomorph
 sage:
 sage: # version 0.36 doesn't have networkx.matching, which appears for the
 first time in 0.37
 sage: import networkx.matching
 ---------------------------------------------------------------------------
 ImportError                               Traceback (most recent call
 last)

 
/home/mvngu/.sage/temp/sage.math.washington.edu/22888/_home_mvngu__sage_init_sage_0.py
 in <module>()

 ImportError: No module named matching
 }}}
 So on the one hand, the fake {{{0.99.p1}}} installs OK against Sage 3.4.2
 and all tests passed even with the option {{{-long}}}. On the other hand,
 it is precisely (fingers crossed) version 0.36 of NetworkX as argued
 above. I hope I've redeemed myself.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5934#comment:1>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to