Skip to content

NestedEdges #

Bases: object

date_time property #

Get the date times of exploded edges.

Returns:

Type Description
NestedUtcDateTimeIterable

dst property #

Returns the destination node of the edge.

Returns:

Type Description
Node

earliest_date_time property #

Returns the earliest date time of the edges.

Returns:

Type Description
NestedUtcDateTimeIterable

earliest_time property #

Returns the earliest time of the edges.

Returns:

Type Description
NestedOptionI64Iterable

end property #

Gets the latest time that this NestedEdges is valid.

Returns:

Type Description
Optional[int]

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

end_date_time property #

Gets the latest datetime that this NestedEdges is valid

Returns:

Type Description
Optional[datetime]

The latest datetime that this NestedEdges is valid or None if the NestedEdges is valid for all times.

id property #

Returns all ids of the edges.

Returns:

Type Description
NestedGIDGIDIterable

latest_date_time property #

Returns the latest date time of the edges.

Returns:

Type Description
NestedUtcDateTimeIterable

latest_time property #

Returns the latest time of the edges.

Returns:

Type Description
NestedOptionI64Iterable

layer_name property #

Returns the name of the layer the edges belong to - assuming they only belong to one layer.

Returns:

Type Description
NestedArcStringIterable

layer_names property #

Returns the names of the layers the edges belong to.

Returns:

Type Description
NestedArcStringVecIterable

metadata property #

Get a view of the metadata only.

Returns:

Type Description
MetadataListList

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 #

Returns all properties of the edges

Returns:

Type Description
PyNestedPropsIterable

src property #

Returns the source node of the edge.

Returns:

Type Description
Nodes

start property #

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

Returns:

Type Description
Optional[int]

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

start_date_time property #

Gets the earliest datetime that this NestedEdges is valid

Returns:

Type Description
Optional[datetime]

The earliest datetime that this NestedEdges is valid or None if the NestedEdges is valid for all times.

time property #

Returns the times of exploded edges.

Returns:

Type Description
NestedOptionI64Iterable

window_size property #

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

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) #

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

Parameters:

Name Type Description Default
start TimeInput

The start time of the window.

required

Returns:

Type Description
NestedEdges

at(time) #

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

Parameters:

Name Type Description Default
time TimeInput

The time of the window.

required

Returns:

Type Description
NestedEdges

before(end) #

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

Parameters:

Name Type Description Default
end TimeInput

The end time of the window.

required

Returns:

Type Description
NestedEdges

collect() #

Collect all edges into a list

Returns:

Type Description
list[list[Edges]]

the list of edges

default_layer() #

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

deletions() #

Returns all timestamps of edges, where an edge is deleted.

Returns:

Type Description
NestedI64VecIterable

A list of lists of lists of unix timestamps

deletions_date_time() #

Returns all timestamps of edges, where an edge is deleted.

Returns:

Type Description
NestedVecUtcDateTimeIterable

A list of lists of lists of DateTime objects

exclude_layer(name) #

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

The layered view

exclude_layers(names) #

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

The layered view

exclude_valid_layer(name) #

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

Returns:

Type Description
NestedEdges

The layered view

exclude_valid_layers(names) #

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

The layered view

expanding(step) #

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

Returns:

Type Description
WindowSet

A WindowSet object.

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) #

Check if NestedEdges has the layer "name"

Parameters:

Name Type Description Default
name str

the name of the layer to check

required

Returns:

Type Description
bool

history() #

Returns all timestamps of edges, when an edge is added or change to an edge is made.

Returns:

Type Description
NestedI64VecIterable

history_date_time() #

Returns all timestamps of edges, when an edge is added or change to an edge is made.

Returns:

Type Description
NestedVecUtcDateTimeIterable

is_active() #

Check if the edges are active (there is at least one update during this time).

Returns:

Type Description
NestedBoolIterable

is_deleted() #

Check if edges are deleted.

Returns:

Type Description
NestedBoolIterable

is_self_loop() #

Check if the edges are on the same node.

Returns:

Type Description
NestedBoolIterable

is_valid() #

Check if edges are valid (i.e., not deleted).

Returns:

Type Description
NestedBoolIterable

latest() #

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

Returns:

Type Description
NestedEdges

layer(name) #

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

The layered view

layers(names) #

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

The layered view

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. step defaults to window.

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

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
NestedEdges

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
NestedEdges

snapshot_at(time) #

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

snapshot_latest() #

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

valid_layers(names) #

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

The layered view

window(start, end) #

Create a view of the NestedEdges 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 None).

required
end TimeInput | None

The end time of the window (unbounded if None).

required

Returns:

Type Description
NestedEdges