~ubuntu-branches/ubuntu/wily/python-networkx/wily

« back to all changes in this revision

Viewing changes to networkx/tests/operators.txt

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-03-02 01:06:32 UTC
  • mfrom: (1.2.1 upstream) (3.1.3 hardy)
  • Revision ID: james.westby@ubuntu.com-20080302010632-1lp6qe1orf59jl8b
* debian/control:
   + Replace python-setuptools with python-pkg-resources in the
     “Recommends:” since pkg_resources is now available in this
     separate package, thanks Matthias Klose (Closes: #468721).
* debian/copyright:
   + Use “© $years $name” instead of invalid “$name, $years” and
     “(C) $years, $name”, thanks to lintian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
-----------------
177
177
 
178
178
>>> R=DiGraph()
179
 
>>> G=union(G1,G2,result=R)
 
179
>>> G=union(G1,G2,create_using=R)
180
180
>>> H=compose(G1,G2)
181
181
>>> sorted(G.edges())==sorted(H.edges())
182
182
True
355
355
True
356
356
>>> degree(H,3)==3
357
357
True
358
 
>>> H.dna['has_node_labels']
359
 
True
360
 
>>> mapping=H.dna['node_labels']
 
358
>>> mapping=H.node_labels
361
359
>>> mapping['C']==3
362
360
True
363
361
>>> mapping['D']==0
377
375
True
378
376
 
379
377
>>> H=convert_node_labels_to_integers(G,ordering="sorted",discard_old_labels=False)
380
 
>>> H.dna['has_node_labels']
381
 
True
382
 
>>> mapping=H.dna['node_labels']
 
378
>>> mapping=H.node_labels
383
379
>>> mapping['A']==0
384
380
True
385
381
>>> mapping['B']==1
410
406
>>> sorted(H.nodes())
411
407
[65, 66, 67, 68]
412
408
 
 
409
 
 
410
create_empty_copy
 
411
-----------------
 
412
>>> G=empty_graph()
 
413
>>> G.add_edges_from([('A','B'),('A','C'),('B','C'),('C','D')])
 
414
>>> H=create_empty_copy(G)
 
415
>>> sorted(H.nodes())
 
416
['A', 'B', 'C', 'D']
 
417
>>> H.edges()
 
418
[]
 
419