NodeStateHistory

A NodeState of History objects for each node.

Methods

MethodDescription
collect_time_entriesCollect and return all the contained time entries as a sorted list.
earliest_timeGet the earliest time entry of all nodes.
flattenFlattens all history objects into a single history object with all time entries ordered.
getGet History object for the node.
itemsIterate over items
latest_timeGet the latest time entry.
nodesIterate over nodes.
sorted_by_idSort results by node id
to_dfConvert results to pandas DataFrame
valuesIterate over History objects.

Properties

PropertyDescription
dtAccess history events as UTC datetimes.
event_idAccess the unique event id of each time entry.
intervalsAccess the intervals between consecutive timestamps in milliseconds.
tAccess history events as timestamps (milliseconds since the Unix epoch).

Method Details

collect_time_entries

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

Returns

TypeDescription
list[EventTime]All time entries as a list.

earliest_time

Get the earliest time entry of all nodes.

Returns

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

TypeDescription
HistoryA history object containing all time entries.

get

Signature: get(node, default=None)

Get History object for the node.

Parameters

NameTypeDefaultDescription
nodeNodeInput-the node
defaultHistory, optionalNoneThe default value. Defaults to None.

Returns

TypeDescription
History, optionalThe value for the node or the default value.

items

Iterate over items

latest_time

Get the latest time entry.

Returns

TypeDescription
OptionalEventTimeThe latest event present in any of the nodes' histories.

nodes

Iterate over nodes.

Returns

TypeDescription
NodesThe nodes.

sorted_by_id

Sort results by node id

Returns

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

TypeDescription
DataFrameA Pandas DataFrame.

values

Iterate over History objects.

Returns

TypeDescription
Iterator[History]Iterator over History objects.

Property Details

dt

Access history events as UTC datetimes.

Returns

TypeDescription
NodeStateHistoryDateTimeA NodeState with the computed HistoryDateTime object for each node.

event_id

Access the unique event id of each time entry.

Returns

TypeDescription
NodeStateHistoryEventIdA NodeState with the computed HistoryEventId object for each node.

intervals

Access the intervals between consecutive timestamps in milliseconds.

Returns

TypeDescription
NodeStateIntervalsA NodeState with the computed Intervals object for each node.

t

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

Returns

TypeDescription
NodeStateHistoryTimestampA NodeState with the computed HistoryTimestamp object for each node.