You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New C++ API for timestamp/duration indices (#9200)
### Related
* Part of #8635
### What
Updated the C++ API to distinguish between absolute timestamps and and
relative durations.
We've deprecated the following functions in `RecordingStream`, with the
following replacements:
* `set_time_sequence` -> `set_index_sequence`
* `set_time` -> `set_index_duration` or `set_index_timestamp`
* `set_time_seconds` -> `set_index_duration_secs` or
`set_index_timestamp_seconds_since_epoch`
* `set_time_nanos` -> `set_index_duration_nanos` or
`set_index_timestamp_nanos_since_epoch`
`TimeColumn` also has deprecated functions.
### Questions to reviewer
The names for the functions in `TimeColumn` are somewhat inconsistent
with those of `RecordingStream`.
### Other notes
I also changed/broke the C API.
### TODO
* [ ] Full check
---------
Co-authored-by: Andreas Reich <[email protected]>
Copy file name to clipboardExpand all lines: docs/content/reference/migration/migration-0-23.md
+22-4
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,16 @@ Previously, you could (confusingly) have two timelines with the same name, as lo
8
8
This is no longer possible.
9
9
Timelines are now uniquely identified by name, and if you use different types on the same timeline, you will get a logged warning, and the _latest_ type will be used to interpret the full set of time data.
10
10
11
-
## 🐍 Python: replaced `rr.set_time_*` with `rr.set_index`
11
+
## Rename some timeline-related things as "index"
12
+
We're planning on adding support for different types of indices in the future, so to that point we're slowly migrating our API to refer to these things as _indices_ rather than _timelines_.
13
+
14
+
## Differentiate between timestamps and durations
15
+
We've added a explicit API for setting time, where you need to explicitly specify if a time is either a timestamp (e.g. `2025-03-03T14:34:56.123456789`) or a duration (e.g. `123s`).
16
+
17
+
Before, Rerun would try to guess what you meant (small values were assumed to be durations, and large values were assumes to be durations since the Unix epoch, i.e. timestamps).
18
+
Now you need to be explicit.
19
+
20
+
### 🐍 Python: replaced `rr.set_time_*` with `rr.set_index`
12
21
We're moving towards a more explicit API for setting time, where you need to explicitly specify if a time is either a datetime (e.g. `2025-03-03T14:34:56.123456789`) or a timedelta (e.g. `123s`).
13
22
14
23
Previously we would infer the user intent at runtime based on the value: if it was large enough, it was interpreted as time since the Unix epoch, otherwise it was interpreted as a timedelta.
@@ -26,7 +35,7 @@ To this end, we're deprecated `rr.set_time_seconds`, `rr.set_time_nanos`, as wel
The former is subject to (double-precision) floating point precision loss (still microsecond precision for the next century), while the latter is lossless.
54
63
55
64
56
-
## 🐍 Python: replaced `rr.Time*Column` with `rr.IndexColumn`
65
+
###🐍 Python: replaced `rr.Time*Column` with `rr.IndexColumn`
57
66
Similarly to the above new `set_index` API, there is also a new `IndexColumn` class that replaces `TimeSequenceColumn`, `TimeSecondsColumn`, and `TimeNanosColumn`.
58
67
The migration is very similar to the above.
59
68
60
-
### Migration
69
+
####Migration
61
70
##### `rr.TimeSequenceColumn("foo", values)`
62
71
New: `rr.IndexColumn("foo", sequence=values)`
63
72
@@ -81,6 +90,15 @@ Either:
81
90
82
91
The former is subject to (double-precision) floating point precision loss (still microsecond precision for the next century), while the latter is lossless.
83
92
93
+
### 🌊 C++: replaced `RecordingStream::set_time_*` with `set_index_*`
94
+
We've deprecated the following functions, with the following replacements:
95
+
*`set_time_sequence` -> `set_index_sequence`
96
+
*`set_time` -> `set_index_duration` or `set_index_timestamp`
97
+
*`set_time_seconds` -> `set_index_duration_secs` or `set_index_timestamp_seconds_since_epoch`
98
+
*`set_time_nanos` -> `set_index_duration_nanos` or `set_index_timestamp_nanos_since_epoch`
99
+
100
+
`TimeColumn` also has deprecated functions.
101
+
84
102
## 🐍 Python: removed `rr.log_components()`, `rr.connect()`, `rr.connect_tcp()`, and `rr.serve()`
85
103
86
104
These functions were [deprecated](migration-0-22.md#python-api-changes) in 0.22 and are no longer available.
0 commit comments