NodeStateHistory
A NodeState of History objects for each node.
Methods
| Method | Description |
|---|---|
collect_time_entries | Collect and return all the contained time entries as a sorted list. |
earliest_time | Get the earliest time entry of all nodes. |
flatten | Flattens all history objects into a single history object with all time entries ordered. |
get | Get History object for the node. |
items | Iterate over items |
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_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
Signature: get(node, default=None)
Get History object for the 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 value for the node or the default value. |
items
Iterate 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. |
Property Details
dt
Access history events as UTC datetimes.
Returns
| Type | Description |
|---|---|
| NodeStateHistoryDateTime | A NodeState with the computed HistoryDateTime object for each node. |
event_id
Access the unique event id of each time entry.
Returns
| Type | Description |
|---|---|
| NodeStateHistoryEventId | A NodeState with the computed HistoryEventId object for each node. |
intervals
Access the intervals between consecutive timestamps in milliseconds.
Returns
| Type | Description |
|---|---|
| NodeStateIntervals | A NodeState with the computed Intervals object for each node. |
t
Access history events as timestamps (milliseconds since the Unix epoch).
Returns
| Type | Description |
|---|---|
| NodeStateHistoryTimestamp | A NodeState with the computed HistoryTimestamp object for each node. |