Commit 66ac9026 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix doctests

parent f06e8def
Pipeline #936 passed with stage
in 39 minutes and 35 seconds
......@@ -1250,19 +1250,19 @@ def edge_endpoint_property(g, prop, endpoint, eprop=None):
>>> g = gt.random_graph(100, lambda: (3, 3))
>>> esource = gt.edge_endpoint_property(g, g.vertex_index, "source")
>>> print(esource.a)
[ 0 0 0 96 96 96 92 92 92 88 88 88 84 84 84 80 80 80 76 76 76 72 72 72
68 68 68 64 64 64 60 60 60 56 56 56 52 52 52 48 48 48 44 44 44 40 40 40
36 36 36 32 32 32 28 28 28 24 24 24 20 20 20 16 16 16 12 12 12 8 8 8
4 4 4 99 99 99 1 1 1 2 2 2 3 3 3 5 5 5 6 6 6 7 7 7
9 9 9 10 10 10 14 14 14 19 19 19 25 25 25 30 30 30 35 35 35 41 41 41
46 46 46 51 51 51 57 57 57 62 62 62 67 67 67 73 73 73 78 78 78 83 83 83
89 89 89 94 94 94 11 11 11 98 98 98 97 97 97 95 95 95 93 93 93 91 91 91
90 90 90 87 87 87 86 86 86 85 85 85 82 82 82 81 81 81 79 79 79 77 77 77
75 75 75 74 74 74 71 71 71 69 69 69 61 61 61 54 54 54 47 47 47 39 39 39
33 33 33 26 26 26 18 18 18 70 70 70 13 13 13 15 15 15 17 17 17 21 21 21
22 22 22 23 23 23 27 27 27 29 29 29 31 31 31 34 34 34 37 37 37 38 38 38
42 42 42 43 43 43 45 45 45 49 49 49 50 50 50 53 53 53 55 55 55 58 58 58
59 59 59 63 63 63 65 65 65 66 66 66]
[50 71 36 51 86 43 54 92 24 32 85 98 94 72 76 8 12 16 36 91 10 15 22 76
52 67 50 64 30 75 48 3 4 57 37 11 29 71 57 65 92 48 75 27 47 21 12 86
38 21 77 73 1 34 63 53 99 14 68 88 53 47 5 38 18 57 79 34 33 32 31 2
63 24 4 33 49 87 60 1 50 62 39 83 97 0 94 84 56 28 28 30 7 61 67 97
52 81 69 78 64 6 82 75 26 66 19 28 14 90 1 17 45 23 46 84 58 36 45 72
86 55 5 34 17 38 20 85 85 99 13 61 17 55 22 18 74 69 91 32 42 9 11 23
46 31 7 29 78 80 93 60 54 31 49 99 73 77 18 46 68 76 95 21 35 70 89 83
81 40 67 70 89 9 40 82 16 5 73 52 41 90 3 45 87 40 35 89 51 49 87 20
66 64 65 70 74 16 62 3 15 98 41 78 56 2 44 94 95 13 62 69 81 55 90 96
10 97 98 96 77 44 25 10 74 88 88 8 58 37 68 7 83 30 6 96 51 54 15 20
42 58 61 93 19 0 79 93 26 84 91 39 9 72 59 27 65 63 80 39 33 48 43 35
56 19 42 12 22 25 44 24 41 59 79 0 13 80 11 47 8 26 53 2 29 82 14 23
6 95 27 25 4 92 71 60 43 59 37 66]
"""
val_t = prop.value_type()
......@@ -1305,13 +1305,12 @@ def incident_edges_op(g, direction, op, eprop, vprop=None):
>>> g = gt.random_graph(100, lambda: (3, 3))
>>> vsum = gt.incident_edges_op(g, "out", "sum", g.edge_index)
>>> print(vsum.a)
[ 3 237 246 255 219 264 273 282 210 291 300 453 201 687 309 696 192 705
669 318 183 714 723 732 174 327 660 741 165 750 336 759 156 651 768 345
147 777 786 642 138 354 795 804 129 813 363 633 120 822 831 372 111 840
624 849 102 381 858 867 93 615 390 876 84 885 894 399 75 606 678 597
66 408 588 579 57 570 417 561 48 552 543 426 39 534 525 516 30 435
507 498 21 489 444 480 12 471 462 228]
[605 241 559 412 398 361 623 469 522 566 459 455 329 615 451 459 390 367
357 615 556 257 424 543 352 782 633 588 286 467 352 368 217 403 243 613
137 561 236 592 528 654 646 563 697 413 417 384 332 419 106 427 299 397
395 467 556 136 585 824 524 466 489 383 320 489 596 289 448 446 531 332
385 385 556 174 198 427 450 586 684 477 562 482 451 265 171 451 510 525
504 407 340 640 305 659 669 396 430 340]
"""
val_t = eprop.value_type()
......@@ -1958,8 +1957,8 @@ class Graph(object):
>>> g = gt.random_graph(6, lambda: 1, directed=False)
>>> g.get_edges([g.edge_index])
array([[0, 3, 2],
[1, 4, 1],
[2, 5, 0]])
[1, 4, 0],
[2, 5, 1]])
"""
edges = libcore.get_edge_list(self.__graph, 0,
[ep._get_any() for ep in eprops])
......
......@@ -1494,11 +1494,11 @@ def label_biconnected_components(g, eprop=None, vprop=None):
>>> g = gt.random_graph(100, lambda: poisson(2), directed=False)
>>> comp, art, hist = gt.label_biconnected_components(g)
>>> print(comp.a)
[45 45 45 45 45 21 45 27 14 45 45 45 45 45 17 45 45 45 45 45 45 45 19 20
45 45 44 45 42 37 45 45 45 45 45 45 38 24 28 45 45 45 45 29 45 6 34 45
2 45 45 9 45 36 33 30 45 45 45 11 23 45 47 45 45 45 45 25 1 48 12 39
18 7 31 40 45 45 13 5 4 45 16 45 8 45 0 45 26 22 10 46 3 50 41 49
43 32 45 35 15]
[45 45 45 45 45 45 21 28 35 45 45 45 11 9 3 45 45 45 45 45 7 45 45 45
45 41 45 45 43 45 45 34 45 45 45 45 40 46 31 45 45 45 26 45 45 45 15 29
45 45 45 45 37 6 45 19 45 45 45 17 45 14 45 45 30 36 10 45 49 18 1 13
2 45 23 48 22 33 45 32 45 45 24 16 45 38 45 45 39 5 4 44 25 27 0 47
42 12 50 20 8]
>>> print(art.a)
[1 0 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0
1 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 0 1 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment