Skip to content

NodeStateHistory #

Bases: object

A NodeState of History objects for each node.

dt property #

Access history events as UTC datetimes.

Returns:

Type Description
NodeStateHistoryDateTime

A NodeState with the computed HistoryDateTime object for each node.

event_id property #

Access the unique event id of each time entry.

Returns:

Type Description
NodeStateHistoryEventId

A NodeState with the computed HistoryEventId object for each node.

intervals property #

Access the intervals between consecutive timestamps in milliseconds.

Returns:

Type Description
NodeStateIntervals

A NodeState with the computed Intervals object for each node.

t property #

Access history events as timestamps (milliseconds since the Unix epoch).

Returns:

Type Description
NodeStateHistoryTimestamp

A NodeState with the computed HistoryTimestamp object for each node.

__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).

collect_time_entries() #

Collect and return all the contained time entries as a sorted list.

Returns:

Type Description
list[EventTime]

All time entries as a list.

earliest_time() #

Get the earliest time entry of all nodes.

Returns:

Type Description
OptionalEventTime

The earliest event present in any of the nodes' histories.

flatten() #

Flattens all history objects into a single history object with all time entries ordered.

Returns:

Type Description
History

A history object containing all time entries.

get(node, default=None) #

Get History object for the node.

Parameters:

Name Type Description Default
node NodeInput

the node

required
default Optional[History]

The default value. Defaults to None.

None

Returns:

Type Description
Optional[History]

The value for the node or the default value.

items() #

Iterate over items

Returns:

Type Description
Iterator[Tuple[Node, History]]

Iterator over items.

latest_time() #

Get the latest time entry.

Returns:

Type Description
OptionalEventTime

The latest event present in any of the nodes' histories.

nodes() #

Iterate over nodes.

Returns:

Type Description
Nodes

The nodes.

sorted_by_id() #

Sort results by node id

Returns:

Type Description
NodeStateHistory

The sorted node state.

to_df() #

Convert results to pandas DataFrame

The DataFrame has two columns, "node" with the node ids and "value" with the corresponding values.

Returns:

Type Description
DataFrame

A Pandas DataFrame.

values() #

Iterate over History objects.

Returns:

Type Description
Iterator[History]

Iterator over History objects.