Nodes
#
Bases: object
A list of nodes that can be iterated over.
earliest_date_time
property
#
The earliest time nodes are active as datetime objects
Returns:
Type | Description |
---|---|
EarliestDateTimeView
|
a view of the earliest active times. |
earliest_time
property
#
The earliest times nodes are active
Returns:
Type | Description |
---|---|
EarliestTimeView
|
a view of the earliest active times |
edges
property
#
Get the edges that are incident to this node.
Returns:
NestedEdges: The incident edges.
end
property
#
Gets the latest time that this Nodes is valid.
Returns:
Type | Description |
---|---|
Optional[int]
|
The latest time that this Nodes is valid or None if the Nodes is valid for all times. |
end_date_time
property
#
Gets the latest datetime that this Nodes is valid
Returns:
Type | Description |
---|---|
Optional[datetime]
|
The latest datetime that this Nodes is valid or None if the Nodes is valid for all times. |
in_edges
property
#
Get the edges that point into this node.
Returns:
NestedEdges: The inbound edges.
in_neighbours
property
#
Get the neighbours of this node that point into this node.
Returns:
PathFromGraph: The in-neighbours.
latest_date_time
property
#
The latest time nodes are active as datetime objects
Returns:
Type | Description |
---|---|
LatestDateTimeView
|
a view of the latest active times |
latest_time
property
#
The latest time nodes are active
Returns:
Type | Description |
---|---|
LatestTimeView
|
a view of the latest active times |
metadata
property
#
The metadata of the nodes.
Returns:
Type | Description |
---|---|
MetadataView
|
A view of the node properties. |
neighbours
property
#
Get the neighbours of this node.
Returns:
PathFromGraph: The neighbours (both inbound and outbound).
node_type
property
#
out_edges
property
#
Get the edges that point out of this node.
Returns:
NestedEdges: The outbound edges.
out_neighbours
property
#
Get the neighbours of this node that point out of this node.
Returns:
PathFromGraph: The out-neighbours.
properties
property
#
start
property
#
Gets the start time for rolling and expanding windows for this Nodes
Returns:
Type | Description |
---|---|
Optional[int]
|
The earliest time that this Nodes is valid or None if the Nodes is valid for all times. |
start_date_time
property
#
Gets the earliest datetime that this Nodes is valid
Returns:
Type | Description |
---|---|
Optional[datetime]
|
The earliest datetime that this Nodes is valid or None if the Nodes is valid for all times. |
window_size
property
#
Get the window size (difference between start and end) for this Nodes
Returns:
Type | Description |
---|---|
Optional[int]
|
|
__bool__()
#
True if self else False
__eq__(value)
#
Return self==value.
__ge__(value)
#
Return self>=value.
__getitem__(key)
#
Return self[key].
__gt__(value)
#
Return self>value.
__iter__()
#
Implement iter(self).
__le__(value)
#
Return self<=value.
__len__()
#
Return len(self).
__lt__(value)
#
Return self<value.
__ne__(value)
#
Return self!=value.
__repr__()
#
Return repr(self).
after(start)
#
at(time)
#
before(end)
#
default_layer()
#
Return a view of Nodes containing only the default edge layer Returns: Nodes: The layered view
degree()
#
Returns the number of edges of the nodes.
Returns:
Type | Description |
---|---|
DegreeView
|
a view of the undirected node degrees. |
edge_history_count()
#
Return the number of edge updates for each node
Returns:
Type | Description |
---|---|
EdgeHistoryCountView
|
a view of the edge history counts |
exclude_layer(name)
#
exclude_layers(names)
#
exclude_valid_layer(name)
#
Return a view of Nodes containing all layers except the excluded name
Arguments:
name (str): layer name that is excluded for the new view
Returns:
Type | Description |
---|---|
Nodes
|
The layered view |
exclude_valid_layers(names)
#
Return a view of Nodes 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 |
---|---|
Nodes
|
The layered view |
expanding(step)
#
filter_edges(filter)
#
Return a filtered view that only includes edges that satisfy the filter
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filter
|
FilterExpr
|
The filter to apply to the edges. |
required |
Returns:
Type | Description |
---|---|
Nodes
|
The filtered view |
filter_exploded_edges(filter)
#
Return a filtered view that only includes exploded edges that satisfy the filter
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filter
|
FilterExpr
|
The filter to apply to the exploded edge properties. |
required |
Returns:
Type | Description |
---|---|
Nodes
|
The filtered view |
filter_nodes(filter)
#
Return a filtered view that only includes nodes that satisfy the filter
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filter
|
FilterExpr
|
The filter to apply to the nodes. |
required |
Returns:
Type | Description |
---|---|
Nodes
|
The filtered view |
has_layer(name)
#
history()
#
Returns all timestamps of nodes, when a node is added or change to a node is made.
Returns:
Type | Description |
---|---|
HistoryView
|
a view of the node histories |
history_date_time()
#
Returns all timestamps of nodes, when a node is added or change to a node is made.
Returns:
Type | Description |
---|---|
HistoryDateTimeView
|
a view of the node histories as datetime objects. |
in_degree()
#
Returns the number of in edges of the nodes.
Returns:
Type | Description |
---|---|
DegreeView
|
a view of the in-degrees of the nodes. |
latest()
#
layer(name)
#
layers(names)
#
out_degree()
#
Returns the number of out edges of the nodes.
Returns:
Type | Description |
---|---|
DegreeView
|
a view of the out-degrees of the nodes. |
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: Nodes:
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 |
---|---|
Nodes
|
|
snapshot_at(time)
#
snapshot_latest()
#
Create a view of the Nodes 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 |
---|---|
Nodes
|
|
to_df(include_property_history=False, convert_datetime=False)
#
Converts the graph's nodes into a Pandas DataFrame.
This method will create a DataFrame with the following columns: - "name": The name of the node. - "properties": The properties of the node. - "update_history": The update history of the node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_property_history
|
bool
|
A boolean, if set to |
False
|
convert_datetime
|
bool
|
A boolean, if set to |
False
|
Returns:
Type | Description |
---|---|
DataFrame
|
the view of the node data as a pandas Dataframe. |
type_filter(node_types)
#
valid_layers(names)
#
window(start, end)
#
Create a view of the Nodes 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 |
---|---|
Nodes
|
|