HistoryView
A lazy view over History objects for each node.
Methods
| Method | Description |
|---|---|
collect | Compute all History objects and return the result as a list |
collect_time_entries | Compute all History objects and return the contained time entries as a sorted list |
compute | Compute all values and return the result as a node view |
earliest_time | Get the earliest time entry. |
flatten | Flattens all history objects into a single history with all time entries ordered. |
get | Get value for node |
items | Iterate over History objects |
latest_time | Get the latest time entry. |
nodes | Iterate over nodes |
sorted_by_id | Sort results by node id |
to_df | Convert results to pandas DataFrame |
values | Iterate over History objects |
Properties
| Property | Description |
|---|---|
dt | Access history events as UTC datetimes. |
event_id | Access the unique event id of each time entry. |
intervals | Access the intervals between consecutive timestamps in milliseconds. |
t | Access history events as timestamps (milliseconds since the Unix epoch). |
Method Details
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
Signature: get(node, default=None)
Get value for node
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
node | NodeInput | - | the node |
default | History, optional | None | the default value. Defaults to None. |
Returns
| Type | Description |
|---|---|
| History, optional | the History object for the node or the default value |
items
Iterate over History objects
latest_time
Get the latest time entry.
Returns
| Type | Description |
|---|---|
| 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 |
Property Details
dt
Access history events as UTC datetimes.
Returns
| Type | Description |
|---|---|
| HistoryDateTimeView | A lazy view over HistoryDateTime objects for each node. |
event_id
Access the unique event id of each time entry.
Returns
| Type | Description |
|---|---|
| HistoryEventIdView | A lazy view over HistoryEventId objects for each node. |
intervals
Access the intervals between consecutive timestamps in milliseconds.
Returns
| Type | Description |
|---|---|
| IntervalsView | A lazy view over Intervals objects for each node. |
t
Access history events as timestamps (milliseconds since the Unix epoch).
Returns
| Type | Description |
|---|---|
| HistoryTimestampView | A lazy view over HistoryTimestamp objects for each node. |