Skip to content

HistoryView #

Bases: object

A lazy view over History objects for each node.

dt property #

Access history events as UTC datetimes.

Returns:

Type Description
HistoryDateTimeView

A lazy view over HistoryDateTime objects for each node.

event_id property #

Access the unique event id of each time entry.

Returns:

Type Description
HistoryEventIdView

A lazy view over HistoryEventId objects for each node.

intervals property #

Access the intervals between consecutive timestamps in milliseconds.

Returns:

Type Description
IntervalsView

A lazy view over Intervals objects for each node.

t property #

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

Returns:

Type Description
HistoryTimestampView

A lazy view over HistoryTimestamp objects 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() #

Compute all History objects and return the result as a list

Returns:

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

Type Description
list[EventTime]

all time entries as a list

compute() #

Compute all values and return the result as a node view

Returns:

Type Description
NodeStateHistory

the computed NodeState

earliest_time() #

Get the earliest time entry.

Returns:

Type Description
EarliestTimeView

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

Type Description
History

a history object containing all time entries

get(node, default=None) #

Get value for 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 History object for the node or the default value

items() #

Iterate over History objects

Returns:

Type Description
Iterator[Tuple[Node, History]]

Iterator over histories

latest_time() #

Get the latest time entry. Returns: LatestTimeView: A lazy view over the latest time of each node as an EventTime.

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 histories