Skip to content

PathFromNode #

Bases: object

earliest_time property #

The earliest time of each node.

Returns:

Type Description
OptionEventTimeIterable

An iterable of EventTimes.

edges property #

Get the edges that are incident to this node.

Returns:

Type Description
Edges

The incident edges.

end property #

Gets the latest time that this PathFromNode is valid.

Returns:

Type Description
OptionalEventTime

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

id property #

The node IDs.

Returns:

Type Description
GIDIterable

in_edges property #

Get the edges that point into this node.

Returns:

Type Description
Edges

The inbound edges.

in_neighbours property #

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

Returns:

Type Description
PathFromNode

The in-neighbours.

latest_time property #

The latest time of each node.

Returns:

Type Description
OptionEventTimeIterable

An iterable of EventTimes.

metadata property #

The node metadata.

Returns:

Type Description
MetadataView

name property #

The node names.

Returns:

Type Description
StringIterable

neighbours property #

Get the neighbours of this node.

Returns:

Type Description
PathFromNode

The neighbours (both inbound and outbound).

node_type property #

The node types.

Returns:

Type Description
OptionArcStringIterable

out_edges property #

Get the edges that point out of this node.

Returns:

Type Description
Edges

The outbound edges.

out_neighbours property #

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

Returns:

Type Description
PathFromNode

The out-neighbours.

properties property #

The node properties.

Returns:

Type Description
PropertiesView

start property #

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

Returns:

Type Description
OptionalEventTime

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

window_size property #

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

Returns:

Type Description
Optional[int]

__bool__() #

True if self else False

__getitem__(key) #

Return self[key].

__iter__() #

Implement iter(self).

__len__() #

Return len(self).

__repr__() #

Return repr(self).

after(start) #

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

Parameters:

Name Type Description Default
start TimeInput

The start time of the window.

required

Returns:

Type Description
PathFromNode

at(time) #

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

Parameters:

Name Type Description Default
time TimeInput

The time of the window.

required

Returns:

Type Description
PathFromNode

before(end) #

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

Parameters:

Name Type Description Default
end TimeInput

The end time of the window.

required

Returns:

Type Description
PathFromNode

collect() #

Collect all nodes into a list

Returns:

Type Description
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

History object with all time entries for the nodes.

default_layer() #

Return a view of PathFromNode containing only the default edge layer Returns: PathFromNode: The layered view

degree() #

The node degrees.

Returns:

Type Description
UsizeIterable

edge_history_count() #

Get the number of edge updates for each node.

Returns:

Type Description
UsizeIterable

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:

Name Type Description Default
name str

layer name that is excluded for the new view

required

Returns:

Type Description
PathFromNode

The layered view

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:

Name Type Description Default
names list[str]

list of layer names that are excluded for the new view

required

Returns:

Type Description
PathFromNode

The layered view

exclude_valid_layer(name) #

Return a view of PathFromNode containing all layers except the excluded name Arguments: name (str): layer name that is excluded for the new view

Returns:

Type Description
PathFromNode

The layered view

exclude_valid_layers(names) #

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

The layered view

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 Description Default
step int | str

The step size of the window.

required
alignment_unit str | 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.

None

Returns:

Type Description
WindowSet

A WindowSet object.

filter(filter) #

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

Parameters:

Name Type Description Default
filter FilterExpr

The filter to apply to the nodes and edges.

required

Returns:

Type Description
PathFromNode

The filtered view

has_layer(name) #

Check if PathFromNode has the layer "name"

Parameters:

Name Type Description Default
name str

the name of the layer to check

required

Returns:

Type Description
bool

in_degree() #

The node in-degrees.

Returns:

Type Description
UsizeIterable

latest() #

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

Returns:

Type Description
PathFromNode

layer(name) #

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

Parameters:

Name Type Description Default
name str

then name of the layer.

required

Returns:

Type Description
PathFromNode

The layered view

layers(names) #

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

Parameters:

Name Type Description Default
names list[str]

list of layer names for the new view

required

Returns:

Type Description
PathFromNode

The layered view

out_degree() #

The node out-degrees.

Returns:

Type Description
UsizeIterable

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 Description Default
window int | str

The size of the window.

required
step int | str | None

The step size of the window. step defaults to window.

None
alignment_unit str | 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.

None

Returns:

Type Description
WindowSet

A WindowSet object.

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: PathFromNode:

shrink_start(start) #

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

Parameters:

Name Type Description Default
start TimeInput

the new start time of the window

required

Returns:

Type Description
PathFromNode

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
PathFromNode

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:

Name Type Description Default
time TimeInput

The time of the window.

required

Returns:

Type Description
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:

Type Description
PathFromNode

type_filter(node_types) #

filter nodes by type

Parameters:

Name Type Description Default
node_types list[str]

the node types to keep

required

Returns:

Type Description
PathFromNode

the filtered view

valid_layers(names) #

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

Parameters:

Name Type Description Default
names list[str]

list of layer names for the new view

required

Returns:

Type Description
PathFromNode

The layered view

window(start, end) #

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

Parameters:

Name Type Description Default
start TimeInput

The start time of the window.

required
end TimeInput

The end time of the window.

required

Returns:

Type Description
PathFromNode