Skip to content

Commit

Permalink
Remove legacy DisconnectedSpace (#2835)
Browse files Browse the repository at this point in the history
This PR removes the old `DisconnectedSpace` entirely.

The legacy `rr.disconnected_space()` have been rewritten in terms of the
new `DisconnectedSpace` archetype.

---

Part of #2791 
Requires #2833 

### What

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2835) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/2835)
- [Docs
preview](https://rerun.io/preview/pr%3Acmc%2Fgoodbye_old_disconnected_space/docs)
- [Examples
preview](https://rerun.io/preview/pr%3Acmc%2Fgoodbye_old_disconnected_space/examples)
  • Loading branch information
teh-cmc authored Jul 28, 2023
1 parent 469046a commit a409abc
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 88 deletions.
36 changes: 0 additions & 36 deletions crates/re_components/src/disconnected_space.rs

This file was deleted.

7 changes: 3 additions & 4 deletions crates/re_components/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ mod class_id;
mod color;
pub mod context;
pub mod coordinates;
mod disconnected_space;
mod keypoint_id;
mod label;
mod linestrip;
Expand Down Expand Up @@ -63,7 +62,6 @@ pub use self::{
bbox::Box3D,
context::{AnnotationContext, AnnotationInfo, ClassDescription},
coordinates::ViewCoordinates,
disconnected_space::DisconnectedSpace,
linestrip::{LineStrip2D, LineStrip3D},
mat::Mat3x3,
mesh3d::{EncodedMesh3D, Mesh3D, MeshFormat, MeshId, RawMesh3D},
Expand Down Expand Up @@ -105,7 +103,8 @@ pub mod external {
// ----------------------------------------------------------------------------

use re_types::components::{
ClassId, Color, DrawOrder, InstanceKey, KeypointId, Label, Point2D, Point3D, Radius,
ClassId, Color, DisconnectedSpace, DrawOrder, InstanceKey, KeypointId, Label, Point2D, Point3D,
Radius,
};

lazy_static! {
Expand All @@ -114,7 +113,6 @@ lazy_static! {
<AnnotationContext as LegacyComponent>::field(),
<Arrow3D as LegacyComponent>::field(),
<Box3D as LegacyComponent>::field(),
<DisconnectedSpace as LegacyComponent>::field(),
<LineStrip2D as LegacyComponent>::field(),
<LineStrip3D as LegacyComponent>::field(),
<Mesh3D as LegacyComponent>::field(),
Expand All @@ -132,6 +130,7 @@ lazy_static! {
<ViewCoordinates as LegacyComponent>::field(),
Field::new(ClassId::name().as_str(), ClassId::to_arrow_datatype(), false),
Field::new(Color::name().as_str(), Color::to_arrow_datatype(), false),
Field::new(DisconnectedSpace::name().as_str(), DisconnectedSpace::to_arrow_datatype(), false),
Field::new(DrawOrder::name().as_str(), DrawOrder::to_arrow_datatype(), false),
Field::new(InstanceKey::name().as_str(), InstanceKey::to_arrow_datatype(), false),
Field::new(KeypointId::name().as_str(), KeypointId::to_arrow_datatype(), false),
Expand Down
12 changes: 6 additions & 6 deletions crates/re_sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ pub mod time {
/// and can be used in [`MsgSender::with_component`].
pub mod components {
pub use re_components::{
AnnotationContext, AnnotationInfo, Arrow3D, Box3D, ClassDescription, DisconnectedSpace,
EncodedMesh3D, LineStrip2D, LineStrip3D, Mat3x3, Mesh3D, MeshFormat, MeshId, Pinhole,
Quaternion, RawMesh3D, Rect2D, Scalar, ScalarPlotProps, Tensor, TensorData,
TensorDataMeaning, TensorDimension, TensorId, TextEntry, Transform3D, Vec2D, Vec3D, Vec4D,
ViewCoordinates,
AnnotationContext, AnnotationInfo, Arrow3D, Box3D, ClassDescription, EncodedMesh3D,
LineStrip2D, LineStrip3D, Mat3x3, Mesh3D, MeshFormat, MeshId, Pinhole, Quaternion,
RawMesh3D, Rect2D, Scalar, ScalarPlotProps, Tensor, TensorData, TensorDataMeaning,
TensorDimension, TensorId, TextEntry, Transform3D, Vec2D, Vec3D, Vec4D, ViewCoordinates,
};
pub use re_types::components::{
ClassId, Color, DrawOrder, InstanceKey, KeypointId, Label, Point2D, Point3D, Radius,
ClassId, Color, DisconnectedSpace, DrawOrder, InstanceKey, KeypointId, Label, Point2D,
Point3D, Radius,
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use nohash_hasher::IntMap;

use re_arrow_store::LatestAtQuery;
use re_components::{DisconnectedSpace, Pinhole, Transform3D, ViewCoordinates};
use re_components::{Pinhole, Transform3D, ViewCoordinates};
use re_data_store::{EntityPath, EntityPropertyMap, EntityTree};
use re_space_view::UnreachableTransformReason;
use re_types::Loggable as _;
use re_types::{components::DisconnectedSpace, Loggable as _};
use re_viewer_context::{ArchetypeDefinition, ViewContextSystem};

use crate::parts::image_view_coordinates;
Expand Down
3 changes: 2 additions & 1 deletion crates/re_viewport/src/space_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ use re_space_view::UnreachableTransformReason;
use std::collections::BTreeMap;

use re_arrow_store::{LatestAtQuery, TimeInt, Timeline};
use re_components::{DisconnectedSpace, Pinhole, Transform3D};
use re_components::{Pinhole, Transform3D};
use re_data_store::{store_db::EntityDb, EntityPath, EntityTree};
use re_types::components::DisconnectedSpace;

/// Transform connecting two space paths.
#[derive(Clone, Debug)]
Expand Down
3 changes: 2 additions & 1 deletion crates/re_viewport/src/space_view_heuristics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ use ahash::HashMap;
use itertools::Itertools;
use nohash_hasher::IntSet;
use re_arrow_store::{LatestAtQuery, Timeline};
use re_components::{DisconnectedSpace, Pinhole, Tensor};
use re_components::{Pinhole, Tensor};
use re_data_store::EntityPath;
use re_types::components::DisconnectedSpace;
use re_viewer_context::{SpaceViewClassName, ViewerContext};

use re_viewer_context::{AutoSpawnHeuristic, ViewPartCollection};
Expand Down
29 changes: 0 additions & 29 deletions rerun_py/rerun_sdk/rerun/components/disconnected_space.py

This file was deleted.

15 changes: 6 additions & 9 deletions rerun_py/rerun_sdk/rerun/log/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
"""
from __future__ import annotations

from typing import Any

import numpy.typing as npt
from deprecated import deprecated

from rerun import bindings
from rerun.components.disconnected_space import DisconnectedSpaceArray
from rerun.components.quaternion import Quaternion
from rerun.components.transform3d import (
Rigid3D,
Expand Down Expand Up @@ -158,11 +155,11 @@ def log_unknown_transform(
If left unspecified, defaults to the current active data recording, if there is one.
See also: [`rerun.init`][], [`rerun.set_global_data_recording`][].
"""
from rerun.experimental import DisconnectedSpace, log

recording = RecordingStream.to_native(recording)

instanced: dict[str, Any] = {}
instanced["rerun.disconnected_space"] = DisconnectedSpaceArray.single()
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless, recording=recording)
log(entity_path, DisconnectedSpace(True), timeless=timeless, recording=recording)


@log_decorator
Expand Down Expand Up @@ -190,11 +187,11 @@ def log_disconnected_space(
If left unspecified, defaults to the current active data recording, if there is one.
See also: [`rerun.init`][], [`rerun.set_global_data_recording`][].
"""
from rerun.experimental import DisconnectedSpace, log

recording = RecordingStream.to_native(recording)

instanced: dict[str, Any] = {}
instanced["rerun.disconnected_space"] = DisconnectedSpaceArray.single()
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless, recording=recording)
log(entity_path, DisconnectedSpace(True), timeless=timeless, recording=recording)


@log_decorator
Expand Down

0 comments on commit a409abc

Please sign in to comment.