You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1a424e6
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/source/edges_vertices.rst
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ and to add them to the graph.
22
22
.. runblock:: pycon
23
23
:session:
24
24
25
-
>>> from pgraph import UGraph, UVertex, Edge
25
+
>>> from pgraph import UGraph, Vertex, Edge
26
26
>>> import numpy as np
27
27
>>> g = UGraph()
28
28
@@ -31,8 +31,8 @@ Next, we will explicitly create two vertices
31
31
.. runblock:: pycon
32
32
:session:
33
33
34
-
>>> v1 =UVertex(np.random.rand(2))
35
-
>>> v2 =UVertex(np.random.rand(2))
34
+
>>> v1 =Vertex(np.random.rand(2))
35
+
>>> v2 =Vertex(np.random.rand(2))
36
36
37
37
38
38
and then add them to the graph
@@ -77,7 +77,7 @@ Alternatively, we can create a vertex and *connect* it to an existing vertex, wh
77
77
.. runblock:: pycon
78
78
:session:
79
79
80
-
>>> v3 =UVertex(np.random.rand(2))
80
+
>>> v3 =Vertex(np.random.rand(2))
81
81
>>> g.add_vertex(v3)
82
82
>>> v2.connect(v3)
83
83
>>> print(g)
@@ -88,11 +88,9 @@ The ``connect`` method is available on both the
88
88
directed and undirected vertex classes.
89
89
90
90
91
-
.. note:: Where ever a vertex or edge is required, a subclass of the appropriate base class can be used. For example, we can create a subclass of ``UVertex`` called ``MyVertex`` and a subclass of ``Edge`` called ``MyEdge`` and then create a new graph using these classes.
91
+
.. note:: Where ever a vertex or edge is required, a subclass of the appropriate base class can be used. For example, we can create a subclass of ``Vertex`` called ``MyVertex`` and a subclass of ``Edge`` called ``MyEdge`` and then create a new graph using these classes.
Copy file name to clipboardExpand all lines: docs/source/intro.rst
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ we can obtain the reference by indexing the graph object. For example vertex 1 i
60
60
61
61
>>> g[1]
62
62
63
-
and is an instance of ``UVertex``, a vertex in an undirected graph; it has the coordinate
63
+
and is an instance of ``Vertex``; it has the coordinate
64
64
:math:`(0.6028, 0.5449)` and has been assigned a default name ``"#1"`` but we could specify
65
65
an explicit name to ``add_vertex``.
66
66
We can also reference a vertex by its name
@@ -201,15 +201,15 @@ Arbitrary data can be attached to any vertex or edge by assigning values to attr
201
201
202
202
This exploits the flexible nature of Python, but care must be taken to avoid name clashes with existing attributes.
203
203
204
-
A more robust and Pythonic approach is to create a subclass of the ``UVertex`` or ``DVertex`` classes class and
205
-
declare them at graph creation time. For example, we can create a subclass of ``UVertex`` called ``MyVertex`` and a subclass of ``Edge`` called ``MyEdge`` and then create a new graph using these classes.
204
+
A more robust and Pythonic approach is to create a subclass of the ``Vertex`` class and
205
+
declare them at graph creation time. For example, we can create a subclass of ``Vertex`` called ``MyVertex`` and a subclass of ``Edge`` called ``MyEdge`` and then create a new graph using these classes.
0 commit comments