Edges
#
Bases: object
A list of edges that can be iterated over.
date_time
property
#
earliest_date_time
property
#
earliest_time
property
#
end
property
#
Gets the latest time that this Edges is valid.
Returns:
Type | Description |
---|---|
Optional[int]
|
The latest time that this Edges is valid or None if the Edges is valid for all times. |
end_date_time
property
#
Gets the latest datetime that this Edges is valid
Returns:
Type | Description |
---|---|
Optional[datetime]
|
The latest datetime that this Edges is valid or None if the Edges is valid for all times. |
id
property
#
latest_date_time
property
#
latest_time
property
#
layer_name
property
#
Get the layer name that all edges belong to - assuming they only belong to one layer
Returns:
Type | Description |
---|---|
ArcStringIterable
|
|
layer_names
property
#
Get the layer names that all edges belong to - assuming they only belong to one layer.
Returns:
Type | Description |
---|---|
ArcStringVecIterable
|
|
metadata
property
#
Returns all the metadata of the edges
Returns:
Type | Description |
---|---|
MetadataView
|
|
nbr
property
#
Returns the node at the other end of the edge (same as dst()
for out-edges and src()
for in-edges)
Returns:
Type | Description |
---|---|
Nodes
|
|
properties
property
#
start
property
#
Gets the start time for rolling and expanding windows for this Edges
Returns:
Type | Description |
---|---|
Optional[int]
|
The earliest time that this Edges is valid or None if the Edges is valid for all times. |
start_date_time
property
#
Gets the earliest datetime that this Edges is valid
Returns:
Type | Description |
---|---|
Optional[datetime]
|
The earliest datetime that this Edges is valid or None if the Edges is valid for all times. |
time
property
#
Returns the times of exploded edges.
Returns:
Type | Description |
---|---|
I64Iterable
|
|
window_size
property
#
Get the window size (difference between start and end) for this Edges
Returns:
Type | Description |
---|---|
Optional[int]
|
|
__bool__()
#
True if self else False
__iter__()
#
Implement iter(self).
__len__()
#
Return len(self).
__repr__()
#
Return repr(self).
after(start)
#
at(time)
#
before(end)
#
default_layer()
#
Return a view of Edges containing only the default edge layer Returns: Edges: The layered view
deletions()
#
Returns all timestamps of edges where an edge is deleted
Returns:
Type | Description |
---|---|
PyGenericIterable
|
|
deletions_date_time()
#
Returns all timestamps of edges where an edge is deleted
Returns:
Type | Description |
---|---|
OptionVecUtcDateTimeIterable
|
|
exclude_layer(name)
#
exclude_layers(names)
#
exclude_valid_layer(name)
#
Return a view of Edges containing all layers except the excluded name
Arguments:
name (str): layer name that is excluded for the new view
Returns:
Type | Description |
---|---|
Edges
|
The layered view |
exclude_valid_layers(names)
#
Return a view of Edges containing all layers except the excluded names
Arguments:
names (list[str]): list of layer names that are excluded for the new view
Returns:
Type | Description |
---|---|
Edges
|
The layered view |
expanding(step)
#
explode()
#
Explodes returns an edge object for each update within the original edge.
Returns:
Type | Description |
---|---|
Exploded
|
|
explode_layers()
#
Explode layers returns an edge object for each layer within the original edge. These new edge object contains only updates from respective layers.
Returns:
Type | Description |
---|---|
Exploded
|
|
has_layer(name)
#
history()
#
Returns all timestamps of edges, when an edge is added or change to an edge is made.
Returns:
Type | Description |
---|---|
PyGenericIterable
|
|
history_counts()
#
Returns the number of times any edge was added or change to an edge was been made.
Returns:
Type | Description |
---|---|
U64Iterable
|
|
history_date_time()
#
Returns all timestamps of edges, when an edge is added or change to an edge is made.
Returns:
Type | Description |
---|---|
OptionVecUtcDateTimeIterable
|
|
is_active()
#
Check if the edges are active (there is at least one update during this time).
Returns:
Type | Description |
---|---|
BoolIterable
|
|
is_deleted()
#
is_self_loop()
#
is_valid()
#
latest()
#
layer(name)
#
layers(names)
#
rolling(window, step=None)
#
Creates a WindowSet
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.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
window
|
int | str
|
The size of the window. |
required |
step
|
int | str | None
|
The step size of the window.
|
None
|
Returns:
Type | Description |
---|---|
WindowSet
|
A |
shrink_end(end)
#
Set the end of the window to the smaller of end
and self.end()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
end
|
TimeInput
|
the new end time of the window |
required |
Returns: Edges:
shrink_start(start)
#
shrink_window(start, end)
#
Shrink both the start and end of the window (same as calling shrink_start
followed by shrink_end
but more efficient)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
TimeInput
|
the new start time for the window |
required |
end
|
TimeInput
|
the new end time for the window |
required |
Returns:
Type | Description |
---|---|
Edges
|
|
snapshot_at(time)
#
snapshot_latest()
#
Create a view of the Edges including all events that have not been explicitly deleted at the latest time.
This is equivalent to a no-op for Graph
and latest()
for PersistentGraph
Returns:
Type | Description |
---|---|
Edges
|
|
to_df(include_property_history=True, convert_datetime=False, explode=False)
#
Converts the graph's edges into a Pandas DataFrame.
This method will create a DataFrame with the following columns:
- "src": The source node of the edge.
- "dst": The destination node of the edge.
- "layer": The layer of the edge.
- "properties": The properties of the edge.
- "update_history": The update history of the edge. This column will be included if include_update_history
is set to true
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_property_history
|
bool
|
A boolean, if set to |
True
|
convert_datetime
|
bool
|
A boolean, if set to |
False
|
explode
|
bool
|
A boolean, if set to |
False
|
Returns:
Type | Description |
---|---|
DataFrame
|
If successful, this PyObject will be a Pandas DataFrame. |
valid_layers(names)
#
window(start, end)
#
Create a view of the Edges including all events between start
(inclusive) and end
(exclusive)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
TimeInput | None
|
The start time of the window (unbounded if |
required |
end
|
TimeInput | None
|
The end time of the window (unbounded if |
required |
Returns:
Type | Description |
---|---|
Edges
|
|