PathFromGraph
Methods
| Method | Description |
|---|---|
after | Create a view of the PathFromGraph including all events after start (exclusive). |
at | Create a view of the PathFromGraph including all events at time. |
before | Create a view of the PathFromGraph including all events before end (exclusive). |
collect | Collect all nodes into a list |
combined_history | Returns a single history object containing time entries for all nodes in the path. |
default_layer | Return a view of PathFromGraph containing only the default edge layer |
degree | Returns the node degrees. |
edge_history_count | Returns the number of edge updates for each node. |
exclude_layer | Return a view of PathFromGraph containing all layers except the excluded name |
exclude_layers | Return a view of PathFromGraph containing all layers except the excluded names |
exclude_valid_layer | Return a view of PathFromGraph containing all layers except the excluded name |
exclude_valid_layers | Return a view of PathFromGraph containing all layers except the excluded names |
expanding | Creates a WindowSet with the given step size using an expanding window. |
filter | Return a filtered view that only includes nodes and edges that satisfy the filter |
has_layer | Check if PathFromGraph has the layer "name" |
in_degree | Returns the node in-degrees. |
latest | Create a view of the PathFromGraph including all events at the latest time. |
layer | Return a view of PathFromGraph containing the layer "name" |
layers | Return a view of PathFromGraph containing all layers names |
out_degree | Returns the node out-degrees. |
rolling | Creates a WindowSet with the given window size and optional step using a rolling window. |
shrink_end | Set the end of the window to the smaller of end and self.end() |
shrink_start | Set the start of the window to the larger of start and self.start() |
shrink_window | Shrink both the start and end of the window (same as calling shrink_start followed by shrink_end but more efficient) |
snapshot_at | Create a view of the PathFromGraph including all events that have not been explicitly deleted at time. |
snapshot_latest | Create a view of the PathFromGraph including all events that have not been explicitly deleted at the latest time. |
type_filter | filter nodes by type |
valid_layers | Return a view of PathFromGraph containing all layers names |
window | Create a view of the PathFromGraph including all events between start (inclusive) and end (exclusive) |
Properties
| Property | Description |
|---|---|
earliest_time | The node earliest times. |
edges | Get the edges that are incident to this node. |
end | Gets the latest time that this PathFromGraph is valid. |
history | Returns a history object for each node with time entries for when a node is added or change to a node is made. |
id | The node ids |
in_edges | Get the edges that point into this node. |
in_neighbours | Get the neighbours of this node that point into this node. |
latest_time | The node latest times. |
metadata | Returns the node metadata. |
name | The node names. |
neighbours | Get the neighbours of this node. |
node_type | The node types. |
out_edges | Get the edges that point out of this node. |
out_neighbours | Get the neighbours of this node that point out of this node. |
properties | Returns the node properties. |
start | Gets the start time for rolling and expanding windows for this PathFromGraph |
window_size | Get the window size (difference between start and end) for this PathFromGraph. |
Method Details
after
Signature: after(start)
Create a view of the PathFromGraph including all events after start (exclusive).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
start | TimeInput | - | The start time of the window. |
Returns
| Type | Description |
|---|---|
| PathFromGraph |
at
Signature: at(time)
Create a view of the PathFromGraph including all events at time.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
time | TimeInput | - | The time of the window. |
Returns
| Type | Description |
|---|---|
| PathFromGraph |
before
Signature: before(end)
Create a view of the PathFromGraph including all events before end (exclusive).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
end | TimeInput | - | The end time of the window. |
Returns
| Type | Description |
|---|---|
| PathFromGraph |
collect
Collect all nodes into a list
Returns
| Type | Description |
|---|---|
| list[list[Node]] | the list of nodes |
combined_history
Returns a single history object containing time entries for all nodes in the path.
Returns
| Type | Description |
|---|---|
| History | A history object with all time entries associated with the nodes. |
default_layer
Return a view of PathFromGraph containing only the default edge layer
Returns
| Type | Description |
|---|---|
| PathFromGraph | The layered view |
degree
Returns the node degrees.
Returns
| Type | Description |
|---|---|
| NestedUsizeIterable |
edge_history_count
Returns the number of edge updates for each node.
Returns
| Type | Description |
|---|---|
| NestedUsizeIterable |
exclude_layer
Signature: exclude_layer(name)
Return a view of PathFromGraph containing all layers except the excluded name
Errors if any of the layers do not exist.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | - | layer name that is excluded for the new view |
Returns
| Type | Description |
|---|---|
| PathFromGraph | The layered view |
exclude_layers
Signature: exclude_layers(names)
Return a view of PathFromGraph containing all layers except the excluded names
Errors if any of the layers do not exist.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
names | list[str] | - | list of layer names that are excluded for the new view |
Returns
| Type | Description |
|---|---|
| PathFromGraph | The layered view |
exclude_valid_layer
Signature: exclude_valid_layer(name)
Return a view of PathFromGraph containing all layers except the excluded name
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | - | layer name that is excluded for the new view |
Returns
| Type | Description |
|---|---|
| PathFromGraph | The layered view |
exclude_valid_layers
Signature: exclude_valid_layers(names)
Return a view of PathFromGraph containing all layers except the excluded names
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
names | list[str] | - | list of layer names that are excluded for the new view |
Returns
| Type | Description |
|---|---|
| PathFromGraph | The layered view |
expanding
Signature: expanding(step, alignment_unit=None)
Creates a WindowSet with the given step size using an expanding window.
An expanding window is a window that grows by step size at each iteration.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
step | int | str | - | The step size of the window. |
alignment_unit | str | None, optional | None | If no alignment_unit is passed, aligns the start of the first window to the smallest unit of time passed to step. For example, if the step is "1 month and 1 day", the windows will be aligned on days (00:00:00 to 23:59:59). If set to "unaligned", the first window will begin at the first time event. If any other alignment unit is passed, the windows will be aligned to that unit. alignment_unit defaults to None. |
Returns
| Type | Description |
|---|---|
| WindowSet | A WindowSet object. |
filter
Signature: filter(filter)
Return a filtered view that only includes nodes and edges that satisfy the filter
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
filter | filter.FilterExpr | - | The filter to apply to the nodes and edges. |
Returns
| Type | Description |
|---|---|
| PathFromGraph | The filtered view |
has_layer
Signature: has_layer(name)
Check if PathFromGraph has the layer "name"
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | - | the name of the layer to check |
Returns
| Type | Description |
|---|---|
| bool |
in_degree
Returns the node in-degrees.
Returns
| Type | Description |
|---|---|
| NestedUsizeIterable |
latest
Create a view of the PathFromGraph including all events at the latest time.
Returns
| Type | Description |
|---|---|
| PathFromGraph |
layer
Signature: layer(name)
Return a view of PathFromGraph containing the layer "name"
Errors if the layer does not exist
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | - | then name of the layer. |
Returns
| Type | Description |
|---|---|
| PathFromGraph | The layered view |
layers
Signature: layers(names)
Return a view of PathFromGraph containing all layers names
Errors if any of the layers do not exist.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
names | list[str] | - | list of layer names for the new view |
Returns
| Type | Description |
|---|---|
| PathFromGraph | The layered view |
out_degree
Returns the node out-degrees.
Returns
| Type | Description |
|---|---|
| NestedUsizeIterable |
rolling
Signature: rolling(window, step=None, alignment_unit=None)
Creates a WindowSet with the given window size and optional step using a rolling window.
If alignment_unit is not "unaligned" and a step larger than window is provided, some time entries
may appear before the start of the first window and/or after the end of the last window (i.e. not included in any window).
A rolling window is a window that moves forward by step size at each iteration.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
window | int | str | - | The size of the window. |
step | int | str | None, optional | None | The step size of the window. step defaults to window. |
alignment_unit | str | None, optional | None | If no alignment_unit is passed, aligns the start of the first window to the smallest unit of time passed to step (or window if no step is passed). For example, if the step is "1 month and 1 day", the first window will begin at the start of the day of the first time event. If set to "unaligned", the first window will begin at the first time event. If any other alignment unit is passed, the windows will be aligned to that unit. alignment_unit defaults to None. |
Returns
| Type | Description |
|---|---|
| WindowSet | A WindowSet object. |
shrink_end
Signature: shrink_end(end)
Set the end of the window to the smaller of end and self.end()
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
end | TimeInput | - | the new end time of the window |
Returns
| Type | Description |
|---|---|
| PathFromGraph |
shrink_start
Signature: shrink_start(start)
Set the start of the window to the larger of start and self.start()
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
start | TimeInput | - | the new start time of the window |
Returns
| Type | Description |
|---|---|
| PathFromGraph |
shrink_window
Signature: 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 | Default | Description |
|---|---|---|---|
start | TimeInput | - | the new start time for the window |
end | TimeInput | - | the new end time for the window |
Returns
| Type | Description |
|---|---|
| PathFromGraph |
snapshot_at
Signature: snapshot_at(time)
Create a view of the PathFromGraph including all events that have not been explicitly deleted at time.
This is equivalent to before(time + 1) for Graph and at(time) for PersistentGraph
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
time | TimeInput | - | The time of the window. |
Returns
| Type | Description |
|---|---|
| PathFromGraph |
snapshot_latest
Create a view of the PathFromGraph 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 |
|---|---|
| PathFromGraph |
type_filter
Signature: type_filter(node_types)
filter nodes by type
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
node_types | list[str] | - | the node types to keep |
Returns
| Type | Description |
|---|---|
| PathFromGraph | the filtered view |
valid_layers
Signature: valid_layers(names)
Return a view of PathFromGraph containing all layers names
Any layers that do not exist are ignored
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
names | list[str] | - | list of layer names for the new view |
Returns
| Type | Description |
|---|---|
| PathFromGraph | The layered view |
window
Signature: window(start, end)
Create a view of the PathFromGraph including all events between start (inclusive) and end (exclusive)
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
start | TimeInput | - | The start time of the window. |
end | TimeInput | - | The end time of the window. |
Returns
| Type | Description |
|---|---|
| PathFromGraph |
Property Details
earliest_time
The node earliest times.
Returns
| Type | Description |
|---|---|
| NestedOptionEventTimeIterable |
edges
Get the edges that are incident to this node.
Returns
| Type | Description |
|---|---|
| NestedEdges | The incident edges. |
end
Gets the latest time that this PathFromGraph is valid.
Returns
| Type | Description |
|---|---|
| OptionalEventTime | The latest time that this PathFromGraph is valid or None if the PathFromGraph is valid for all times. |
history
Returns a history object for each node with time entries for when a node is added or change to a node is made.
Returns
| Type | Description |
|---|---|
| NestedHistoryIterable | A nested iterable of history objects, one for each node. |
id
The node ids
Returns
| Type | Description |
|---|---|
| NestedGIDIterable |
in_edges
Get the edges that point into this node.
Returns
| Type | Description |
|---|---|
| NestedEdges | The inbound edges. |
in_neighbours
Get the neighbours of this node that point into this node.
Returns
| Type | Description |
|---|---|
| PathFromGraph | The in-neighbours. |
latest_time
The node latest times.
Returns
| Type | Description |
|---|---|
| NestedOptionEventTimeIterable |
metadata
Returns the node metadata.
Returns
| Type | Description |
|---|---|
| MetadataListList |
name
The node names.
Returns
| Type | Description |
|---|---|
| NestedStringIterable |
neighbours
Get the neighbours of this node.
Returns
| Type | Description |
|---|---|
| PathFromGraph | The neighbours (both inbound and outbound). |
node_type
The node types.
Returns
| Type | Description |
|---|---|
| NestedOptionArcStringIterable |
out_edges
Get the edges that point out of this node.
Returns
| Type | Description |
|---|---|
| NestedEdges | The outbound edges. |
out_neighbours
Get the neighbours of this node that point out of this node.
Returns
| Type | Description |
|---|---|
| PathFromGraph | The out-neighbours. |
properties
Returns the node properties.
Returns
| Type | Description |
|---|---|
NestedPropsIterable |
start
Gets the start time for rolling and expanding windows for this PathFromGraph
Returns
| Type | Description |
|---|---|
| OptionalEventTime | The earliest time that this PathFromGraph is valid or None if the PathFromGraph is valid for all times. |
window_size
Get the window size (difference between start and end) for this PathFromGraph.
Returns
| Type | Description |
|---|---|
| int, optional |