History
History of updates for an object. Provides access to time entries and derived views such as timestamps, datetimes, event ids, and intervals.
Methods
| Method | Description |
|---|
collect | Collect all time entries in chronological order. |
collect_rev | Collect all time entries in reverse chronological order. |
compose_histories | Compose multiple History objects into a single History by fusing their time entries in chronological order. |
earliest_time | Get the earliest time entry. |
is_empty | Check whether the history has no entries. |
latest_time | Get the latest time entry. |
merge | Merge this History with another by interleaving entries in time order. |
reverse | Return a History where iteration order is reversed. |
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 Unix the epoch). |
Method Details
Collect all time entries in chronological order.
Returns
| Type | Description |
|---|
| list[EventTime] | Collected time entries. |
Collect all time entries in reverse chronological order.
Returns
| Type | Description |
|---|
| list[EventTime] | Collected time entries in reverse order. |
Signature: compose_histories(objects)
Compose multiple History objects into a single History by fusing their time entries in chronological order.
Parameters
| Name | Type | Default | Description |
|---|
objects | Iterable[History] | - | History objects to compose. |
Returns
| Type | Description |
|---|
| History | Composed History object containing entries from all inputs. |
Get the earliest time entry.
Returns
Check whether the history has no entries.
Returns
| Type | Description |
|---|
| bool | True if empty, otherwise False. |
Get the latest time entry.
Returns
Signature: merge(other)
Merge this History with another by interleaving entries in time order.
Parameters
| Name | Type | Default | Description |
|---|
other | History | - | Right-hand history to merge. |
Returns
| Type | Description |
|---|
| History | Merged history containing entries from both inputs. |
Return a History where iteration order is reversed.
Returns
| Type | Description |
|---|
| History | History that yields items in reverse chronological order. |
Property Details
Access history events as UTC datetimes.
Returns
Access the unique event id of each time entry.
Returns
Access the intervals between consecutive timestamps in milliseconds.
Returns
| Type | Description |
|---|
| Intervals | Intervals view of this history. |
Access history events as timestamps (milliseconds since Unix the epoch).
Returns