HistoryView

A lazy view over History objects for each node.

Methods

MethodDescription
collectCompute all History objects and return the result as a list
collect_time_entriesCompute all History objects and return the contained time entries as a sorted list
computeCompute all values and return the result as a node view
earliest_timeGet the earliest time entry.
flattenFlattens all history objects into a single history with all time entries ordered.
getGet value for node
itemsIterate over History objects
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

Compute all History objects and return the result as a list

Returns

TypeDescription
list[History]all History objects as a list

collect_time_entries

Compute all History objects and return the contained time entries as a sorted list

Returns

TypeDescription
list[EventTime]all time entries as a list

compute

Compute all values and return the result as a node view

Returns

TypeDescription
NodeStateHistorythe computed NodeState

earliest_time

Get the earliest time entry.

Returns

TypeDescription
EarliestTimeViewA lazy view over the earliest time of each node as an EventTime.

flatten

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

Returns

TypeDescription
Historya history object containing all time entries

get

Signature: get(node, default=None)

Get value for node

Parameters

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

Returns

TypeDescription
History, optionalthe History object for the node or the default value

items

Iterate over History objects

latest_time

Get the latest time entry.

Returns

TypeDescription
LatestTimeViewA lazy view over the latest time of each node as an EventTime.

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 histories

Property Details

dt

Access history events as UTC datetimes.

Returns

TypeDescription
HistoryDateTimeViewA lazy view over HistoryDateTime objects for each node.

event_id

Access the unique event id of each time entry.

Returns

TypeDescription
HistoryEventIdViewA lazy view over HistoryEventId objects for each node.

intervals

Access the intervals between consecutive timestamps in milliseconds.

Returns

TypeDescription
IntervalsViewA lazy view over Intervals objects for each node.

t

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

Returns

TypeDescription
HistoryTimestampViewA lazy view over HistoryTimestamp objects for each node.