Skip to content

Commit

Permalink
finally get rid of 'timeless'
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jan 20, 2025
1 parent a0f2cf2 commit a9769f4
Show file tree
Hide file tree
Showing 60 changed files with 115 additions and 217 deletions.
8 changes: 4 additions & 4 deletions crates/store/re_chunk/src/batcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ mod tests {
fn simple_static() -> anyhow::Result<()> {
let batcher = ChunkBatcher::new(ChunkBatcherConfig::NEVER)?;

let timeless = TimePoint::default();
let static_ = TimePoint::default();

let points1 = MyPoint::to_arrow([MyPoint::new(1.0, 2.0), MyPoint::new(3.0, 4.0)])?;
let points2 = MyPoint::to_arrow([MyPoint::new(10.0, 20.0), MyPoint::new(30.0, 40.0)])?;
Expand All @@ -1090,9 +1090,9 @@ mod tests {
let components2 = [(MyPoint::descriptor(), points2.clone())];
let components3 = [(MyPoint::descriptor(), points3.clone())];

let row1 = PendingRow::new(timeless.clone(), components1.into_iter().collect());
let row2 = PendingRow::new(timeless.clone(), components2.into_iter().collect());
let row3 = PendingRow::new(timeless.clone(), components3.into_iter().collect());
let row1 = PendingRow::new(static_.clone(), components1.into_iter().collect());
let row2 = PendingRow::new(static_.clone(), components2.into_iter().collect());
let row3 = PendingRow::new(static_.clone(), components3.into_iter().collect());

let entity_path1: EntityPath = "a/b/c".into();
batcher.push_row(entity_path1.clone(), row1.clone());
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_chunk_store/tests/correctness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fn row_id_ordering_semantics() -> anyhow::Result<()> {
}

// Static data has last-write-wins semantics, as defined by RowId-ordering.
// Timeless is RowId-ordered too!
// Static data is RowId-ordered too!
//
// * Insert static `point1` with a random `RowId`.
// * Insert static `point2` using `point1`'s `RowId`, decremented by one.
Expand Down
8 changes: 4 additions & 4 deletions crates/store/re_entity_db/src/entity_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ pub struct CompactedStoreEvents {
/// What time points were deleted for each entity+timeline+component?
pub temporal: IntMap<EntityPathHash, IntMap<Timeline, IntMap<ComponentName, Vec<TimeInt>>>>,

/// For each entity+component, how many timeless entries were deleted?
pub timeless: IntMap<EntityPathHash, IntMap<ComponentName, u64>>,
/// For each entity+component, how many static entries were deleted?
pub static_: IntMap<EntityPathHash, IntMap<ComponentName, u64>>,
}

impl CompactedStoreEvents {
Expand All @@ -70,13 +70,13 @@ impl CompactedStoreEvents {
.flat_map(|event| event.chunk.row_ids())
.collect(),
temporal: Default::default(),
timeless: Default::default(),
static_: Default::default(),
};

for event in store_events {
if event.is_static() {
let per_component = this
.timeless
.static_
.entry(event.chunk.entity_path().hash())
.or_default();
for component_name in event.chunk.component_names() {
Expand Down
4 changes: 2 additions & 2 deletions crates/store/re_entity_db/src/time_histogram_per_timeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ pub type TimeHistogram = re_int_histogram::Int64Histogram;

/// Number of messages per time per timeline.
///
/// Does NOT include timeless.
/// Does NOT include static data.
#[derive(Default)]
pub struct TimeHistogramPerTimeline {
/// When do we have data? Ignores timeless.
/// When do we have data? Ignores static data.
times: BTreeMap<Timeline, TimeHistogram>,

/// Extra bookkeeping used to seed any timelines that include static msgs.
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_log_types/src/time_point/time_int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl TimeInt {
/// It is illegal to create a [`TimeInt`] with that value in a temporal context.
///
/// SDK users cannot log data at that timestamp explicitly, the only way to do so is to use
/// the timeless APIs.
/// the static APIs.
pub const STATIC: Self = Self(None);

/// Value used to represent the minimal temporal value a [`TimeInt`] can hold.
Expand Down
8 changes: 4 additions & 4 deletions crates/store/re_query/tests/latest_at.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,14 +469,14 @@ fn static_invalidation() {

let entity_path = "points";

let timeless = TimePoint::default();
let static_ = TimePoint::default();

let query_time = [build_frame_nr(9999)];

let row_id1 = RowId::new();
let points = vec![MyPoint::new(1.0, 2.0), MyPoint::new(3.0, 4.0)];
let chunk = Chunk::builder(entity_path.into())
.with_component_batches(row_id1, timeless.clone(), [&points as _])
.with_component_batches(row_id1, static_.clone(), [&points as _])
.build()
.unwrap();
insert_and_react(&mut store.write(), &mut caches, &Arc::new(chunk));
Expand All @@ -498,7 +498,7 @@ fn static_invalidation() {
let row_id2 = RowId::new();
let colors = vec![MyColor::from_rgb(255, 0, 0)];
let chunk = Chunk::builder(entity_path.into())
.with_component_batches(row_id2, timeless.clone(), [&colors as _])
.with_component_batches(row_id2, static_.clone(), [&colors as _])
.build()
.unwrap();
insert_and_react(&mut store.write(), &mut caches, &Arc::new(chunk));
Expand All @@ -520,7 +520,7 @@ fn static_invalidation() {
let row_id3 = RowId::new();
let colors = vec![MyColor::from_rgb(0, 0, 255)];
let chunk = Chunk::builder(entity_path.into())
.with_component_batches(row_id3, timeless.clone(), [&colors as _])
.with_component_batches(row_id3, static_.clone(), [&colors as _])
.build()
.unwrap();
insert_and_react(&mut store.write(), &mut caches, &Arc::new(chunk));
Expand Down
18 changes: 9 additions & 9 deletions crates/store/re_query/tests/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ fn static_range() -> anyhow::Result<()> {

// --- Second test: `[timepoint1, timepoint3]` ---

// The inclusion of `timepoint1` means latest-at semantics will fall back to timeless data!
// The inclusion of `timepoint1` means latest-at semantics will fall back to static data!

let query = RangeQuery::new(
timepoint1[0].0,
Expand Down Expand Up @@ -628,7 +628,7 @@ fn invalidation() {
);
};

let timeless = TimePoint::default();
let static_ = TimePoint::default();
let frame_122 = build_frame_nr(122);
let frame_123 = build_frame_nr(123);
let frame_124 = build_frame_nr(124);
Expand All @@ -643,7 +643,7 @@ fn invalidation() {
test_invalidation(
RangeQuery::new(frame_123.0, ResolvedTimeRange::EVERYTHING),
[frame_123].into(),
timeless,
static_,
[frame_124].into(),
);
}
Expand Down Expand Up @@ -683,7 +683,7 @@ fn invalidation_of_future_optionals() {

let entity_path = "points";

let timeless = TimePoint::default();
let static_ = TimePoint::default();
let frame2 = [build_frame_nr(2)];
let frame3 = [build_frame_nr(3)];

Expand All @@ -692,7 +692,7 @@ fn invalidation_of_future_optionals() {
let row_id1 = RowId::new();
let points1 = vec![MyPoint::new(1.0, 2.0), MyPoint::new(3.0, 4.0)];
let chunk1 = Chunk::builder(entity_path.into())
.with_component_batch(row_id1, timeless, &points1)
.with_component_batch(row_id1, static_, &points1)
.build()
.unwrap();
insert_and_react(&mut store.write(), &mut caches, &Arc::new(chunk1));
Expand Down Expand Up @@ -784,15 +784,15 @@ fn invalidation_static() {

let entity_path = "points";

let timeless = TimePoint::default();
let static_ = TimePoint::default();

let frame0 = [build_frame_nr(TimeInt::ZERO)];
let query = RangeQuery::new(frame0[0].0, ResolvedTimeRange::EVERYTHING);

let row_id1 = RowId::new();
let points1 = vec![MyPoint::new(1.0, 2.0), MyPoint::new(3.0, 4.0)];
let chunk1 = Chunk::builder(entity_path.into())
.with_component_batch(row_id1, timeless.clone(), &points1)
.with_component_batch(row_id1, static_.clone(), &points1)
.build()
.unwrap();
insert_and_react(&mut store.write(), &mut caches, &Arc::new(chunk1));
Expand All @@ -813,7 +813,7 @@ fn invalidation_static() {
let row_id2 = RowId::new();
let colors2 = vec![MyColor::from_rgb(255, 0, 0)];
let chunk2 = Chunk::builder(entity_path.into())
.with_component_batch(row_id2, timeless.clone(), &colors2)
.with_component_batch(row_id2, static_.clone(), &colors2)
.build()
.unwrap();
insert_and_react(&mut store.write(), &mut caches, &Arc::new(chunk2));
Expand All @@ -833,7 +833,7 @@ fn invalidation_static() {
let row_id3 = RowId::new();
let colors3 = vec![MyColor::from_rgb(0, 0, 255)];
let chunk3 = Chunk::builder(entity_path.into())
.with_component_batch(row_id3, timeless, &colors3)
.with_component_batch(row_id3, static_, &colors3)
.build()
.unwrap();
insert_and_react(&mut store.write(), &mut caches, &Arc::new(chunk3));
Expand Down
27 changes: 2 additions & 25 deletions crates/top/re_sdk/src/recording_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,17 +1030,6 @@ impl RecordingStream {
Ok(())
}

#[deprecated(since = "0.16.0", note = "use `log_static` instead")]
#[doc(hidden)]
#[inline]
pub fn log_timeless<AS: ?Sized + AsComponents>(
&self,
ent_path: impl Into<EntityPath>,
arch: &AS,
) -> RecordingStreamResult<()> {
self.log_static(ent_path, arch)
}

/// Log data to Rerun.
///
/// It can be used to log anything
Expand Down Expand Up @@ -1071,18 +1060,6 @@ impl RecordingStream {
self.log_with_static(ent_path, true, as_components)
}

#[deprecated(since = "0.16.0", note = "use `log_static` instead")]
#[doc(hidden)]
#[inline]
pub fn log_with_timeless<AS: ?Sized + AsComponents>(
&self,
ent_path: impl Into<EntityPath>,
static_: bool,
arch: &AS,
) -> RecordingStreamResult<()> {
self.log_with_static(ent_path, static_, arch)
}

/// Logs the contents of a [component bundle] into Rerun.
///
/// If `static_` is set to `true`, all timestamp data associated with this message will be
Expand Down Expand Up @@ -2585,14 +2562,14 @@ mod tests {
.unwrap();
}

fn example_rows(timeless: bool) -> Vec<PendingRow> {
fn example_rows(static_: bool) -> Vec<PendingRow> {
use re_log_types::example_components::{MyColor, MyLabel, MyPoint};
use re_types_core::{Component as _, Loggable};

let mut tick = 0i64;
let mut timepoint = |frame_nr: i64| {
let mut tp = TimePoint::default();
if !timeless {
if !static_ {
tp.insert(Timeline::log_time(), Time::now());
tp.insert(Timeline::log_tick(), tick);
tp.insert(Timeline::new_sequence("frame_nr"), frame_nr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Notes:
.time_i64()
.unwrap_or_default()
.at_least(*time_drag_value.range.start()),
); // accounts for timeless time (TimeInt::MIN)
); // accounts for static time (TimeInt::MIN)

if *has_individual_time_range {
let time_range = match query_range {
Expand Down
2 changes: 1 addition & 1 deletion docs/content/concepts/annotation-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Keypoints are currently only applicable to 2D and 3D points.

### Logging an annotation context

Annotation Context is typically logged as [timeless](timelines.md#timeless-data) data, but can change over time if needed.
Annotation Context is typically logged as [static](timelines.md#static-data) data, but can change over time if needed.

The Annotation Context is defined as a list of Class Descriptions that define how classes are styled
(as well as optional keypoint style and connection).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ def main() -> None:
for symbol in symbols:
stock = yf.Ticker(symbol)

# Log the stock info document as timeless
rr.log(f"stocks/{symbol}/info", info_card(**stock.info), timeless=True)
# Log the stock info document as static
rr.log(f"stocks/{symbol}/info", info_card(**stock.info), static=True)

for day in dates:
# Log the styling data as timeless
rr.log(f"stocks/{symbol}/{day}", style_plot(symbol), timeless=True)
rr.log(f"stocks/{symbol}/peaks/{day}", style_peak(symbol), timeless=True)
# Log the styling data as static
rr.log(f"stocks/{symbol}/{day}", style_plot(symbol), static=True)
rr.log(f"stocks/{symbol}/peaks/{day}", style_peak(symbol), static=True)

# Query the stock data during market hours
open_time = dt.datetime.combine(day, dt.time(9, 30), et_timezone)
Expand Down
4 changes: 2 additions & 2 deletions docs/content/howto/integrations/ros2-nav-turtlebot.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ if node_data:
translation=world_from_mesh[3, 0:3],
mat3x3=world_from_mesh[0:3, 0:3],
),
timeless=timeless,
static=static,
)


Expand All @@ -459,7 +459,7 @@ if node_data:
vertex_normals=mesh.vertex_normals,
albedo_factor=albedo_factor,
),
timeless=timeless,
static=static,
)
```

Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Check out [`examples/python/template/README.md`](python/template/README.md) to s

You are also encourage to add a _short_ `DESCRIPTION = """…"""` markdown to the top of the `main.py` and then log it with:
```py
rr.log("description", rr.TextDocument(DESCRIPTION, media_type=rr.MediaType.MARKDOWN), timeless=True)
rr.log("description", rr.TextDocument(DESCRIPTION, media_type=rr.MediaType.MARKDOWN), static=True)
```

## Adding a new example
Expand Down
3 changes: 1 addition & 2 deletions examples/cpp/external_data_loader/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ file with Rerun (`rerun file.cpp`).
("application-id", "Optional recommended ID for the application", cxxopts::value<std::string>())
("recording-id", "Optional recommended ID for the recording", cxxopts::value<std::string>())
("entity-path-prefix", "Optional prefix for all entity paths", cxxopts::value<std::string>())
("timeless", "Deprecated: alias for `--static`", cxxopts::value<bool>()->default_value("false"))
("static", "Optionally mark data to be logged as static", cxxopts::value<bool>()->default_value("false"))
("time", "Optional timestamps to log at (e.g. `--time sim_time=1709203426`) (repeatable)", cxxopts::value<std::vector<std::string>>())
("sequence", "Optional sequences to log at (e.g. `--sequence sim_frame=42`) (repeatable)", cxxopts::value<std::vector<std::string>>())
Expand Down Expand Up @@ -121,7 +120,7 @@ file with Rerun (`rerun file.cpp`).
}
rec.log_with_static(
entity_path,
args["static"].as<bool>() || args["timeless"].as<bool>(),
args["static"].as<bool>(),
rerun::TextDocument(text).with_media_type(rerun::MediaType::markdown())
);
}
2 changes: 1 addition & 1 deletion examples/cpp/ros2_bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ https://vimeo.com/940929187?autoplay=1&loop=1&autopause=0&background=1&muted=1&r

This is an example that shows how to use Rerun's C++ API to log and visualize [ROS 2](https://www.ros.org/) messages.

It works by subscribing to all topics with supported types, converting the messages, and logging the data to Rerun. It further allows to remap topic names to specific entity paths, specify additional timeless transforms, and pinhole parameters via an external config file. See the [launch](https://github.com/rerun-io/cpp-example-ros2-bridge/tree/main/rerun_bridge/launch) directory for usage examples.
It works by subscribing to all topics with supported types, converting the messages, and logging the data to Rerun. It further allows to remap topic names to specific entity paths, specify additional static transforms, and pinhole parameters via an external config file. See the [launch](https://github.com/rerun-io/cpp-example-ros2-bridge/tree/main/rerun_bridge/launch) directory for usage examples.

## Run the code

Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/ros_bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A proof-of-concept Rerun bridge for ROS 1 that subscribes to all supported topic

This is an example that shows how to use Rerun's C++ API to log and visualize [ROS](https://www.ros.org/) messages.

It works by subscribing to all topics with supported types, converting the messages, and logging the data to Rerun. It further allows to remap topic names to specific entity paths, specify additional timeless transforms, and pinhole parameters via an external config file. See the [launch](https://github.com/rerun-io/cpp-example-ros-bridge/tree/main/rerun_bridge/launch) directory for usage examples.
It works by subscribing to all topics with supported types, converting the messages, and logging the data to Rerun. It further allows to remap topic names to specific entity paths, specify additional static transforms, and pinhole parameters via an external config file. See the [launch](https://github.com/rerun-io/cpp-example-ros-bridge/tree/main/rerun_bridge/launch) directory for usage examples.


<picture>
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/vrs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ _rec->log(

## Text document
```cpp
_rec->log_timeless(_entity_path + "/configuration", rerun::TextDocument(layout_str));
_rec->log_static(_entity_path + "/configuration", rerun::TextDocument(layout_str));
```
# Run the code
Expand Down
6 changes: 3 additions & 3 deletions examples/python/arkit_scenes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ rr.log(
vertex_colors=mesh.visual.vertex_colors,
triangle_indices=mesh.faces,
),
timeless=True,
static=True,
)
```
Here, the mesh is logged to the world/mesh entity and is marked as timeless, since it does not change in the context of this visualization.
Here, the mesh is logged to the world/mesh entity and is marked as static, since it does not change in the context of this visualization.

### Logging 3D bounding boxes
Here we loop through the data and add bounding boxes to all the items found.
Expand All @@ -70,7 +70,7 @@ for i, label_info in enumerate(annotation["data"]):
colors=colors[i],
),
rr.InstancePoses3D(mat3x3=mat3x3),
timeless=True,
static=True,
)
```

Expand Down
6 changes: 3 additions & 3 deletions examples/python/blueprint_stocks/blueprint_stocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def main() -> None:
# In a future blueprint release, this can move into the blueprint as well
for symbol in symbols:
for day in dates:
rr.log(f"stocks/{symbol}/{day}", style_plot(symbol), timeless=True)
rr.log(f"stocks/{symbol}/peaks/{day}", style_peak(symbol), timeless=True)
rr.log(f"stocks/{symbol}/{day}", style_plot(symbol), static=True)
rr.log(f"stocks/{symbol}/peaks/{day}", style_peak(symbol), static=True)

for symbol in symbols:
stock = yf.Ticker(symbol)
Expand All @@ -194,7 +194,7 @@ def main() -> None:
rr.log(
f"stocks/{symbol}/info",
rr.TextDocument(info_md, media_type=rr.MediaType.MARKDOWN),
timeless=True,
static=True,
)

for day in dates:
Expand Down
Loading

0 comments on commit a9769f4

Please sign in to comment.