Edge#
- class raphtory.Edge#
Bases:
object
PyEdge is a Python class that represents an edge in the graph. An edge is a directed connection between two vertices.
Methods:
at
(end)Get a new Edge with the properties of this Edge at a specified time.
expanding
(step)Get the duration of the Edge.
explode
()Explodes an Edge into a list of PyEdges.
Explodes an Edge into a list of PyEdges, one for each layer the edge is part of.
history
()Returns a list of timestamps of when an edge is added or change to an edge is made.
layer
(name)Get a new Edge with the properties of this Edge within the specified layer.
layers
(layer_names)Get a new Edge with the properties of this Edge within the specified layers.
rolling
(window[, step])Get a set of Edge windows for a given window size, step, start time and end time using rolling window.
window
([start, end])Get a new Edge with the properties of this Edge within the specified time window.
Attributes:
Gets the datetime of an exploded edge.
Get the destination vertex of the Edge.
Gets of earliest datetime of an edge.
Gets the earliest time of an edge.
Get the end time of the Edge.
Get the end datetime of the Edge.
The id of the edge.
Gets of latest datetime of an edge.
Gets the latest time of an edge.
Gets the name of the layer this edge belongs to - assuming it only belongs to one layer
Gets the names of the layers this edge belongs to
Returns a view of the properties of the edge.
Get the source vertex of the Edge.
Get the start time of the Edge.
Get the start datetime of the Edge.
Gets the time of an exploded edge.
- at(end)#
Get a new Edge with the properties of this Edge at a specified time.
- Parameters:
end (int, str or datetime(utrc)) – The time to get the properties at.
- Returns:
A new Edge with the properties of this Edge at a specified time.
- date_time#
Gets the datetime of an exploded edge.
- Returns:
(datetime) the datetime of an exploded edge
- dst#
Get the destination vertex of the Edge.
- Returns:
The destination vertex of the Edge.
- earliest_date_time#
Gets of earliest datetime of an edge.
- Returns:
the earliest datetime of an edge
- earliest_time#
Gets the earliest time of an edge.
- Returns:
(int) The earliest time of an edge
- end#
Get the end time of the Edge.
- Returns:
The end time of the Edge.
- end_date_time#
Get the end datetime of the Edge.
- Returns:
The end datetime of the Edge
- expanding(step)#
Get the duration of the Edge.
- Parameters:
step (int or str) – The step size to use when calculating the duration.
- Returns:
A set of windows containing edges that fall in the time period
- explode()#
Explodes an Edge into a list of PyEdges. This is useful when you want to iterate over the properties of an Edge at every single point in time. This will return a seperate edge each time a property had been changed.
- Returns:
A list of PyEdges
- explode_layers()#
Explodes an Edge into a list of PyEdges, one for each layer the edge is part of. This is useful when you want to iterate over the properties of an Edge for every layer.
- Returns:
A list of PyEdges
- history()#
Returns a list of timestamps of when an edge is added or change to an edge is made.
- Returns:
A list of timestamps.
- id#
The id of the edge.
- latest_date_time#
Gets of latest datetime of an edge.
- Returns:
(datetime) the latest datetime of an edge
- latest_time#
Gets the latest time of an edge.
- Returns:
(int) The latest time of an edge
- layer(name)#
Get a new Edge with the properties of this Edge within the specified layer.
- Parameters:
layer_names (str) – Layer to be included in the new edge.
- Returns:
A new Edge with the properties of this Edge within the specified time window.
- layer_name#
Gets the name of the layer this edge belongs to - assuming it only belongs to one layer
- Returns:
(List<str>) The name of the layer
- layer_names#
Gets the names of the layers this edge belongs to
- Returns:
(List<str>) The name of the layer
- layers(layer_names)#
Get a new Edge with the properties of this Edge within the specified layers.
- Parameters:
layer_names (List<str>) – Layers to be included in the new edge.
- Returns:
A new Edge with the properties of this Edge within the specified time window.
- properties#
Returns a view of the properties of the edge.
- Returns:
Properties on the Edge.
- rolling(window, step=None)#
Get a set of Edge windows for a given window size, step, start time and end time using rolling window. A rolling window is a window that moves forward by step size at each iteration.
- Parameters:
window (int or str) – The size of the window.
step (int or str) – The step size to use when calculating the duration. (optional)
- Returns:
A set of windows containing edges that fall in the time period
- src#
Get the source vertex of the Edge.
- Returns:
The source vertex of the Edge.
- start#
Get the start time of the Edge.
- Returns:
The start time of the Edge.
- start_date_time#
Get the start datetime of the Edge.
- Returns:
The start datetime of the Edge.
- time#
Gets the time of an exploded edge.
- Returns:
(int) The time of an exploded edge
- window(start=None, end=None)#
Get a new Edge with the properties of this Edge within the specified time window.
- Parameters:
start (int or str) – The start time of the window (optional).
end (int or str) – The end time of the window (optional).
- Returns:
A new Edge with the properties of this Edge within the specified time window.
- class raphtory.Edges#
Bases:
object
A list of edges that can be iterated over.
Methods:
at
(end)Get edges with the properties of these edges at a specific time.
collect
()Returns all edges as a list
count
()Returns the number of edges
explode
()Explodes the edges into a list of edges.
Explodes each edge into a list of edges, one for each layer the edge is part of.
history
()Returns all timestamps of edges, when an edge is added or change to an edge is made.
layer
(name)Get edges with the properties of these edges within the specified layer.
layers
(layer_names)Get edges with the properties of these edges within the specified layers.
window
([start, end])Get edges with the properties of these edges within the specific time window.
Attributes:
Returns the date times of exploded edges
Returns all destination vertices as an iterable
Returns the earliest date time of the edges.
Returns the earliest time of the edges.
Get the end time of all edges
Get the end date time of all edges
Returns all ids of the edges.
Returns the latest date time of the edges.
Returns the latest time of the edges.
Get the layer name that all edges belong to - assuming they only belong to one layer
Get the layer names that all edges belong to - assuming they only belong to one layer
Returns all properties of the edges
Returns all source vertices of the Edges as an iterable.
Get the start time of all edges
Get the start date time of all edges
Returns the times of exploded edges
- at(end)#
Get edges with the properties of these edges at a specific time.
- Parameters:
end (int) – The time to get the properties at.
- Returns:
A list of edges with the properties of these edges at a specific time.
- collect()#
Returns all edges as a list
- count()#
Returns the number of edges
- date_time#
Returns the date times of exploded edges
- Returns:
A list of date times.
- dst#
Returns all destination vertices as an iterable
- earliest_date_time#
Returns the earliest date time of the edges.
- Returns:
Earliest date time of the edges.
- earliest_time#
Returns the earliest time of the edges.
Returns: Earliest time of the edges.
- end#
Get the end time of all edges
Returns: The end time of all edges
- end_date_time#
Get the end date time of all edges
- Returns:
The end date time of all edges
- explode()#
Explodes the edges into a list of edges. This is useful when you want to iterate over the properties of an Edge at every single point in time. This will return a seperate edge each time a property had been changed.
- explode_layers()#
Explodes each edge into a list of edges, one for each layer the edge is part of. This is useful when you want to iterate over the properties of an Edge for every layer.
- history()#
Returns all timestamps of edges, when an edge is added or change to an edge is made.
- Returns:
A list of timestamps.
- id#
Returns all ids of the edges.
- latest_date_time#
Returns the latest date time of the edges.
- Returns:
Latest date time of the edges.
- latest_time#
Returns the latest time of the edges.
- Returns:
Latest time of the edges.
- layer(name)#
Get edges with the properties of these edges within the specified layer.
- Parameters:
name (str) – The name of the layer.
- Returns:
A list of edges with the properties of these edges within the specified layer.
- layer_name#
Get the layer name that all edges belong to - assuming they only belong to one layer
- Returns:
The name of the layer
- layer_names#
Get the layer names that all edges belong to - assuming they only belong to one layer
- Returns:
A list of layer names
- layers(layer_names)#
Get edges with the properties of these edges within the specified layers.
- Parameters:
layer_names ([str]) – The names of the layers.
- Returns:
A list of edges with the properties of these edges within the specified layers.
- properties#
Returns all properties of the edges
- src#
Returns all source vertices of the Edges as an iterable.
- Returns:
The source vertices of the Edges as an iterable.
- start#
Get the start time of all edges
Returns: The start time of all edges
- start_date_time#
Get the start date time of all edges
Returns: The start date time of all edges
- time#
Returns the times of exploded edges
- Returns:
Time of edge
- window(start=None, end=None)#
Get edges with the properties of these edges within the specific time window.
- Parameters:
start (int | str) – The start time of the window (optional).
end (int | str) – The end time of the window (optional).
- Returns:
A list of edges with the properties of these edges within the specified time window.