PathFromNode

Methods

MethodDescription
afterCreate a view of the PathFromNode including all events after start (exclusive).
atCreate a view of the PathFromNode including all events at time.
beforeCreate a view of the PathFromNode including all events before end (exclusive).
collectCollect all nodes into a list
combined_historyReturns a single history object containing time entries for all nodes in the path.
default_layerReturn a view of PathFromNode containing only the default edge layer
degreeThe node degrees.
edge_history_countGet the number of edge updates for each node.
exclude_layerReturn a view of PathFromNode containing all layers except the excluded name
exclude_layersReturn a view of PathFromNode containing all layers except the excluded names
exclude_valid_layerReturn a view of PathFromNode containing all layers except the excluded name
exclude_valid_layersReturn a view of PathFromNode containing all layers except the excluded names
expandingCreates a WindowSet with the given step size using an expanding window.
filterReturn a filtered view that only includes nodes and edges that satisfy the filter
has_layerCheck if PathFromNode has the layer "name"
in_degreeThe node in-degrees.
latestCreate a view of the PathFromNode including all events at the latest time.
layerReturn a view of PathFromNode containing the layer "name"
layersReturn a view of PathFromNode containing all layers names
out_degreeThe node out-degrees.
rollingCreates a WindowSet with the given window size and optional step using a rolling window.
shrink_endSet the end of the window to the smaller of end and self.end()
shrink_startSet the start of the window to the larger of start and self.start()
shrink_windowShrink both the start and end of the window (same as calling shrink_start followed by shrink_end but more efficient)
snapshot_atCreate a view of the PathFromNode including all events that have not been explicitly deleted at time.
snapshot_latestCreate a view of the PathFromNode including all events that have not been explicitly deleted at the latest time.
type_filterfilter nodes by type
valid_layersReturn a view of PathFromNode containing all layers names
windowCreate a view of the PathFromNode including all events between start (inclusive) and end (exclusive)

Properties

PropertyDescription
earliest_timeThe earliest time of each node.
edgesGet the edges that are incident to this node.
endGets the latest time that this PathFromNode is valid.
idThe node IDs.
in_edgesGet the edges that point into this node.
in_neighboursGet the neighbours of this node that point into this node.
latest_timeThe latest time of each node.
metadataThe node metadata.
nameThe node names.
neighboursGet the neighbours of this node.
node_typeThe node types.
out_edgesGet the edges that point out of this node.
out_neighboursGet the neighbours of this node that point out of this node.
propertiesThe node properties.
startGets the start time for rolling and expanding windows for this PathFromNode
window_sizeGet the window size (difference between start and end) for this PathFromNode.

Method Details

after

Signature: after(start)

Create a view of the PathFromNode including all events after start (exclusive).

Parameters

NameTypeDefaultDescription
startTimeInput-The start time of the window.

Returns

TypeDescription
PathFromNode

at

Signature: at(time)

Create a view of the PathFromNode including all events at time.

Parameters

NameTypeDefaultDescription
timeTimeInput-The time of the window.

Returns

TypeDescription
PathFromNode

before

Signature: before(end)

Create a view of the PathFromNode including all events before end (exclusive).

Parameters

NameTypeDefaultDescription
endTimeInput-The end time of the window.

Returns

TypeDescription
PathFromNode

collect

Collect all nodes into a list

Returns

TypeDescription
list[Node]the list of nodes

combined_history

Returns a single history object containing time entries for all nodes in the path.

Returns

TypeDescription
HistoryHistory object with all time entries for the nodes.

default_layer

Return a view of PathFromNode containing only the default edge layer

Returns

TypeDescription
PathFromNodeThe layered view

degree

The node degrees.

Returns

TypeDescription
UsizeIterable

edge_history_count

Get the number of edge updates for each node.

Returns

TypeDescription
UsizeIterable

exclude_layer

Signature: exclude_layer(name)

Return a view of PathFromNode containing all layers except the excluded name Errors if any of the layers do not exist.

Parameters

NameTypeDefaultDescription
namestr-layer name that is excluded for the new view

Returns

TypeDescription
PathFromNodeThe layered view

exclude_layers

Signature: exclude_layers(names)

Return a view of PathFromNode containing all layers except the excluded names Errors if any of the layers do not exist.

Parameters

NameTypeDefaultDescription
nameslist[str]-list of layer names that are excluded for the new view

Returns

TypeDescription
PathFromNodeThe layered view

exclude_valid_layer

Signature: exclude_valid_layer(name)

Return a view of PathFromNode containing all layers except the excluded name

Parameters

NameTypeDefaultDescription
namestr-layer name that is excluded for the new view

Returns

TypeDescription
PathFromNodeThe layered view

exclude_valid_layers

Signature: exclude_valid_layers(names)

Return a view of PathFromNode containing all layers except the excluded names

Parameters

NameTypeDefaultDescription
nameslist[str]-list of layer names that are excluded for the new view

Returns

TypeDescription
PathFromNodeThe 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

NameTypeDefaultDescription
stepint | str-The step size of the window.
alignment_unitstr | None, optionalNoneIf 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

TypeDescription
WindowSetA WindowSet object.

filter

Signature: filter(filter)

Return a filtered view that only includes nodes and edges that satisfy the filter

Parameters

NameTypeDefaultDescription
filterfilter.FilterExpr-The filter to apply to the nodes and edges.

Returns

TypeDescription
PathFromNodeThe filtered view

has_layer

Signature: has_layer(name)

Check if PathFromNode has the layer "name"

Parameters

NameTypeDefaultDescription
namestr-the name of the layer to check

Returns

TypeDescription
bool

in_degree

The node in-degrees.

Returns

TypeDescription
UsizeIterable

latest

Create a view of the PathFromNode including all events at the latest time.

Returns

TypeDescription
PathFromNode

layer

Signature: layer(name)

Return a view of PathFromNode containing the layer "name" Errors if the layer does not exist

Parameters

NameTypeDefaultDescription
namestr-then name of the layer.

Returns

TypeDescription
PathFromNodeThe layered view

layers

Signature: layers(names)

Return a view of PathFromNode containing all layers names Errors if any of the layers do not exist.

Parameters

NameTypeDefaultDescription
nameslist[str]-list of layer names for the new view

Returns

TypeDescription
PathFromNodeThe layered view

out_degree

The node out-degrees.

Returns

TypeDescription
UsizeIterable

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

NameTypeDefaultDescription
windowint | str-The size of the window.
stepint | str | None, optionalNoneThe step size of the window. step defaults to window.
alignment_unitstr | None, optionalNoneIf 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

TypeDescription
WindowSetA WindowSet object.

shrink_end

Signature: shrink_end(end)

Set the end of the window to the smaller of end and self.end()

Parameters

NameTypeDefaultDescription
endTimeInput-the new end time of the window

Returns

TypeDescription
PathFromNode

shrink_start

Signature: shrink_start(start)

Set the start of the window to the larger of start and self.start()

Parameters

NameTypeDefaultDescription
startTimeInput-the new start time of the window

Returns

TypeDescription
PathFromNode

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

NameTypeDefaultDescription
startTimeInput-the new start time for the window
endTimeInput-the new end time for the window

Returns

TypeDescription
PathFromNode

snapshot_at

Signature: snapshot_at(time)

Create a view of the PathFromNode 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

NameTypeDefaultDescription
timeTimeInput-The time of the window.

Returns

TypeDescription
PathFromNode

snapshot_latest

Create a view of the PathFromNode 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

TypeDescription
PathFromNode

type_filter

Signature: type_filter(node_types)

filter nodes by type

Parameters

NameTypeDefaultDescription
node_typeslist[str]-the node types to keep

Returns

TypeDescription
PathFromNodethe filtered view

valid_layers

Signature: valid_layers(names)

Return a view of PathFromNode containing all layers names Any layers that do not exist are ignored

Parameters

NameTypeDefaultDescription
nameslist[str]-list of layer names for the new view

Returns

TypeDescription
PathFromNodeThe layered view

window

Signature: window(start, end)

Create a view of the PathFromNode including all events between start (inclusive) and end (exclusive)

Parameters

NameTypeDefaultDescription
startTimeInput-The start time of the window.
endTimeInput-The end time of the window.

Returns

TypeDescription
PathFromNode

Property Details

earliest_time

The earliest time of each node.

Returns

TypeDescription
OptionEventTimeIterableAn iterable of EventTimes.

edges

Get the edges that are incident to this node.

Returns

TypeDescription
EdgesThe incident edges.

end

Gets the latest time that this PathFromNode is valid.

Returns

TypeDescription
OptionalEventTimeThe latest time that this PathFromNode is valid or None if the PathFromNode is valid for all times.

id

The node IDs.

Returns

TypeDescription
GIDIterable

in_edges

Get the edges that point into this node.

Returns

TypeDescription
EdgesThe inbound edges.

in_neighbours

Get the neighbours of this node that point into this node.

Returns

TypeDescription
PathFromNodeThe in-neighbours.

latest_time

The latest time of each node.

Returns

TypeDescription
OptionEventTimeIterableAn iterable of EventTimes.

metadata

The node metadata.

Returns

TypeDescription
MetadataView

name

The node names.

Returns

TypeDescription
StringIterable

neighbours

Get the neighbours of this node.

Returns

TypeDescription
PathFromNodeThe neighbours (both inbound and outbound).

node_type

The node types.

Returns

out_edges

Get the edges that point out of this node.

Returns

TypeDescription
EdgesThe outbound edges.

out_neighbours

Get the neighbours of this node that point out of this node.

Returns

TypeDescription
PathFromNodeThe out-neighbours.

properties

The node properties.

Returns

TypeDescription
PropertiesView

start

Gets the start time for rolling and expanding windows for this PathFromNode

Returns

TypeDescription
OptionalEventTimeThe earliest time that this PathFromNode is valid or None if the PathFromNode is valid for all times.

window_size

Get the window size (difference between start and end) for this PathFromNode.

Returns

TypeDescription
int, optional