Vertex#
- class raphtory.Vertex#
Bases:
object
A vertex (or node) in the graph.
Methods:
at
(end)Create a view of the vertex including all events at t.
Create a view including all the edges in the default layer
degree
()Get the degree of this vertex (i.e., the number of edges that are incident to it).
expanding
(step)Creates a PyVertexWindowSet with the given step size and optional start and end times, using an expanding window.
history
()Returns the history of a vertex, including vertex additions and changes made to vertex.
Get the in-degree of this vertex (i.e., the number of edges that are incident to it from other vertices).
layer
(name)Create a view including all the edges in the layers name
layers
(names)Create a view including all the edges in the layers names
Get the out-degree of this vertex (i.e., the number of edges that are incident to it from this vertex).
rolling
(window[, step])Creates a PyVertexWindowSet with the given window size and optional step, start and end times, using a rolling window.
window
([start, end])Create a view of the vertex including all events between start (inclusive) and end (exclusive)
Attributes:
Returns the earliest datetime that the vertex exists.
Returns the earliest time that the vertex exists.
Get the edges that are pointing to or from this vertex.
Gets the latest time that this vertex is valid.
Gets the latest datetime that this vertex is valid
Returns the id of the vertex.
Get the edges that are pointing to this vertex.
Get the neighbours of this vertex that are pointing to it.
Returns the latest datetime that the vertex exists.
Returns the latest time that the vertex exists.
Returns the name of the vertex.
Get the neighbours of this vertex.
Get the edges that are pointing from this vertex.
Get the neighbours of this vertex that are pointing from it.
The properties of the vertex
Gets the earliest time that this vertex is valid.
Gets the earliest datetime that this vertex is valid
- at(end)#
Create a view of the vertex including all events at t.
- Parameters:
end (int, str or datetime(utc)) – The time of the window.
- Returns:
A PyVertex object.
- default_layer()#
Create a view including all the edges in the default layer
- Returns:
a view including all the edges in the default layer
- degree()#
Get the degree of this vertex (i.e., the number of edges that are incident to it).
- Returns
The degree of this vertex.
- earliest_date_time#
Returns the earliest datetime that the vertex exists.
- Returns:
The earliest datetime that the vertex exists as an integer.
- earliest_time#
Returns the earliest time that the vertex exists.
- Returns:
The earliest time that the vertex exists as an integer.
- edges#
Get the edges that are pointing to or from this vertex.
- Returns:
A list of Edge objects.
- end#
Gets the latest time that this vertex is valid.
- Returns:
The latest time that this vertex is valid or None if the vertex is valid for all times.
- end_date_time#
Gets the latest datetime that this vertex is valid
- Returns:
The latest datetime that this vertex is valid or None if the vertex is valid for all times.
- expanding(step)#
Creates a PyVertexWindowSet with the given step size and optional start and end times, using an expanding window.
An expanding window is a window that grows by step size at each iteration. This will tell you whether a vertex exists at different points in the window and what its properties are at those points.
- Parameters:
step (int) – The step size of the window.
- Returns:
A PyVertexWindowSet object.
- history()#
Returns the history of a vertex, including vertex additions and changes made to vertex.
- Returns:
A list of timestamps of the event history of vertex.
- id#
Returns the id of the vertex. This is a unique identifier for the vertex.
- Returns:
The id of the vertex as an integer.
- in_degree()#
Get the in-degree of this vertex (i.e., the number of edges that are incident to it from other vertices).
- Returns:
The in-degree of this vertex.
- in_edges#
Get the edges that are pointing to this vertex.
- Returns:
A list of Edge objects.
- in_neighbours#
Get the neighbours of this vertex that are pointing to it.
- Returns:
A list of Vertex objects.
- latest_date_time#
Returns the latest datetime that the vertex exists.
- Parameters:
None –
- Returns:
The latest datetime that the vertex exists as an integer.
- latest_time#
Returns the latest time that the vertex exists.
- Returns:
The latest time that the vertex exists as an integer.
- layer(name)#
Create a view including all the edges in the layers name
- Parameters:
name (str) – the name of the layer to include
- Returns:
a view including all the edges in the layer name
- layers(names)#
Create a view including all the edges in the layers names
- Parameters:
name (str) – the name of the layers to include
- Returns:
a view including all the edges in the layers names
- name#
Returns the name of the vertex.
- Returns:
The name of the vertex as a string.
- neighbours#
Get the neighbours of this vertex.
- Returns:
A list of Vertex objects.
- out_degree()#
Get the out-degree of this vertex (i.e., the number of edges that are incident to it from this vertex).
- Returns:
The out-degree of this vertex.
- out_edges#
Get the edges that are pointing from this vertex.
- Returns:
A list of Edge objects.
- out_neighbours#
Get the neighbours of this vertex that are pointing from it.
- Returns:
A list of Vertex objects.
- properties#
The properties of the vertex
- Returns:
A list of properties.
- rolling(window, step=None)#
Creates a PyVertexWindowSet with the given window size and optional step, start and end times, using a rolling window.
A rolling window is a window that moves forward by step size at each iteration. This will tell you whether a vertex exists at different points in the window and what its properties are at those points.
- Parameters:
window – The size of the window.
step – The step size of the window. Defaults to the window size.
- Returns:
A PyVertexWindowSet object.
- start#
Gets the earliest time that this vertex is valid.
- Returns:
The earliest time that this vertex is valid or None if the vertex is valid for all times.
- start_date_time#
Gets the earliest datetime that this vertex is valid
- Returns:
The earliest datetime that this vertex is valid or None if the vertex is valid for all times.
- window(start=None, end=None)#
Create a view of the vertex including all events between start (inclusive) and end (exclusive)
- Parameters:
start (int, str or datetime(utc)) – The start time of the window. Defaults to the start time of the vertex.
end (int, str or datetime(utc)) – The end time of the window. Defaults to the end time of the vertex.
- Returns:
A PyVertex object.
- class raphtory.Vertices#
Bases:
object
A list of vertices that can be iterated over.
Methods:
at
(end)Create a view of the vertices including all events at t.
collect
()Collects all vertices into a list
Create a view including all the edges in the default layer
degree
()Returns the number of edges of the vertices
expanding
(step)Creates a PyVertexWindowSet with the given step size using an expanding window.
Returns the number of in edges of the vertices
layer
(name)Create a view including all the edges in the layers names
Returns the number of out edges of the vertices
rolling
(window[, step])Creates a PyVertexWindowSet with the given window size and optional step using a rolling window.
window
([start, end])Create a view of the vertices including all events between start (inclusive) and end (exclusive)
Attributes:
Returns an iterator over the vertices earliest time
Returns the edges of the vertices
Returns the end time of the vertices
Returns an iterator over the vertices ids
Returns the in edges of the vertices
Get the in neighbours of the vertices
Returns an iterator over the vertices latest time
Returns an iterator over the vertices name
Get the neighbours of the vertices
Returns the out edges of the vertices
Get the out neighbours of the vertices
The properties of the vertex
Returns the start time of the vertices
Returns the size of the window covered by this view
- at(end)#
Create a view of the vertices including all events at t.
- Parameters:
end (int, str or datetime(utc)) – The time of the window.
- Returns:
A PyVertices object.
- collect()#
Collects all vertices into a list
- default_layer()#
Create a view including all the edges in the default layer
- Returns:
a view including all the edges in the default layer
- degree()#
Returns the number of edges of the vertices
- Returns:
An iterator of the number of edges of the vertices
- earliest_time#
Returns an iterator over the vertices earliest time
- edges#
Returns the edges of the vertices
- Returns:
An iterator of edges of the vertices
- end#
Returns the end time of the vertices
- expanding(step)#
Creates a PyVertexWindowSet with the given step size using an expanding window.
An expanding window is a window that grows by step size at each iteration. This will tell you whether a vertex exists at different points in the window and what its properties are at those points.
- Parameters:
window (step - The step size of the) –
- Returns:
A PyVertexWindowSet with the given step size and optional start and end times or an error
- id#
Returns an iterator over the vertices ids
- in_degree()#
Returns the number of in edges of the vertices
- Returns:
An iterator of the number of in edges of the vertices
- in_edges#
Returns the in edges of the vertices
- Returns:
An iterator of in edges of the vertices
- in_neighbours#
Get the in neighbours of the vertices
- Returns:
An iterator of the in neighbours of the vertices
- latest_time#
Returns an iterator over the vertices latest time
- layer(name)#
Create a view including all the edges in the layers names
- Parameters:
name (str) – the name of the layers to include
- Returns:
a view including all the edges in the layers names
- name#
Returns an iterator over the vertices name
- neighbours#
Get the neighbours of the vertices
- Returns:
An iterator of the neighbours of the vertices
- out_degree()#
Returns the number of out edges of the vertices
- Returns:
An iterator of the number of out edges of the vertices
- out_edges#
Returns the out edges of the vertices
- Returns:
An iterator of out edges of the vertices
- out_neighbours#
Get the out neighbours of the vertices
- Returns:
An iterator of the out neighbours of the vertices
- properties#
The properties of the vertex
- Returns:
A List of properties
- rolling(window, step=None)#
Creates a PyVertexWindowSet with the given window size and optional step using a rolling window.
A rolling window is a window that moves forward by step size at each iteration. This will tell you whether a vertex exists at different points in the window and what its properties are at those points.
- Parameters:
window (str or int) – The window size of the window
step (str or int) – The step size of the window
- Returns:
A PyVertexWindowSet with the given window size and optional step size or an error
- start#
Returns the start time of the vertices
- window(start=None, end=None)#
Create a view of the vertices including all events between start (inclusive) and end (exclusive)
- Parameters:
start (int, str or datetime(utc)) – The start time of the window (inclusive)
end (int, str or datetime(utc)) – The end time of the window (exclusive)
- Returns:
A PyVertices object of vertices within the window.
- window_size#
Returns the size of the window covered by this view
- Returns:
the size of the window
- Return type:
int