Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate legacy Points{2|3}D and all their components #2768

Merged
merged 37 commits into from
Jul 28, 2023

Conversation

teh-cmc
Copy link
Member

@teh-cmc teh-cmc commented Jul 20, 2023

The points2d and points3d views are now both implemented in terms of the new components (that was already the case for points2d).


This PR removes all of these:

  • DrawOrder
  • Point2D
  • Point3D
  • Radius
  • InstanceKey

and deprecates all of those:

  • Color
  • Label
  • ClassId
  • KeypointId

The reason these last four are merely deprecated rather than removed entirely is that the legacy AnnotationContext depends on them, and more specifically depends on their respective implementations of arrow2-convert's traits.
Still, they have been confined into tight corners as much as possible.

The deprecated type are prefixed with Legacy, e.g. LegacyLabel.
In particular, ColorRGBA is now LegacyColor.

In Rust, the new components aren't hidden behind an experimental module anymore, instead they are transparently merged with the rest of the components.


The new Point2D component implements the old LegacyComponent trait to allow all of the old re_query test suites to continue working, until we remove them all soon.


The legacy point logging APIs, log_point & log_points, have been rewritten in terms of the Points2D & Points3D archetypes.

In order to do so, I had to make their position argument mandatory, i.e. you can not write this anymore: rr.log_points("a/b/c", colors=[red, red, blue]).
This is not a problem for two reasons:

  1. This won't ever see the light of release anyway, since this PR marks the cutoff point of 0.8, and this code must be removed in order to release 0.9 (assuming 0.9 is the release of HOPE).
  2. This never worked to begin with, so we know for a fact that no one ever relied on that behavior anyhow.

cc @Wumpf, the custom view example got a bit more verbose and should get much much better once we tackle #2778. We could also just modify it to use an existing archetype instead (which would have to be either Points2D or Points3D at the moment).


Fixes #2790

What

Checklist

@teh-cmc teh-cmc added 🐍 Python API Python logging API 🦀 Rust API Rust logging API codegen/idl labels Jul 20, 2023
@teh-cmc teh-cmc force-pushed the cmc/goodbye_old_point branch from 7ca7b0d to 33ac381 Compare July 20, 2023 17:18
@jleibs jleibs force-pushed the jleibs/hope_legacy_shims branch from 8f05cdf to 25b60c3 Compare July 21, 2023 00:16
Base automatically changed from jleibs/hope_legacy_shims to main July 21, 2023 00:47
@teh-cmc teh-cmc force-pushed the cmc/goodbye_old_point branch 2 times, most recently from 4e656a9 to b3ba377 Compare July 21, 2023 11:11
@teh-cmc teh-cmc changed the base branch from main to cmc/points3d_arch July 21, 2023 11:11
@teh-cmc teh-cmc force-pushed the cmc/points3d_arch branch 2 times, most recently from c9587f7 to 77c1f92 Compare July 21, 2023 13:49
Base automatically changed from cmc/points3d_arch to main July 21, 2023 13:49
@teh-cmc teh-cmc force-pushed the cmc/goodbye_old_point branch from b3ba377 to 155b472 Compare July 21, 2023 14:04
@teh-cmc teh-cmc changed the title Deprecate legacy Point2D, use new Point2D all the way through Deprecate legacy Point{2|3}D, use new Point{2|3}D all the way through Jul 21, 2023
@teh-cmc teh-cmc changed the title Deprecate legacy Point{2|3}D, use new Point{2|3}D all the way through Deprecate legacy Points{2|3}D, use new Points{2|3}D all the way through Jul 21, 2023
@teh-cmc teh-cmc force-pushed the cmc/goodbye_old_point branch 3 times, most recently from 281c7d0 to d4403d0 Compare July 24, 2023 16:55
@teh-cmc teh-cmc changed the title Deprecate legacy Points{2|3}D, use new Points{2|3}D all the way through Deprecate legacy Points{2|3}D and all their components Jul 24, 2023
@teh-cmc teh-cmc force-pushed the cmc/goodbye_old_point branch from edb792f to d70ec97 Compare July 24, 2023 18:10
@teh-cmc teh-cmc marked this pull request as ready for review July 24, 2023 18:12
@teh-cmc teh-cmc added the do-not-merge Do not merge this PR label Jul 24, 2023
@teh-cmc teh-cmc force-pushed the cmc/goodbye_old_point branch 8 times, most recently from b348b39 to 0bfbd10 Compare July 27, 2023 08:46
@teh-cmc teh-cmc force-pushed the cmc/goodbye_old_point branch from 96c777e to d0f296f Compare July 28, 2023 08:30
@Wumpf Wumpf self-requested a review July 28, 2023 09:16
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 🚢

crates/re_space_view_spatial/src/parts/mod.rs Show resolved Hide resolved
@@ -49,6 +49,7 @@ arrow2 = { workspace = true, features = [
"compute_concatenate",
] }
anyhow.workspace = true
arrow2_convert.workspace = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pain is temporary :|

Comment on lines +51 to +74
fn try_to_arrow(
&self,
) -> re_types::SerializationResult<
Vec<(
re_viewer::external::arrow2::datatypes::Field,
Box<dyn re_viewer::external::arrow2::array::Array>,
)>,
> {
unimplemented!()
}

fn try_from_arrow(
_data: impl IntoIterator<
Item = (
re_viewer::external::arrow2::datatypes::Field,
Box<dyn re_viewer::external::arrow2::array::Array>,
),
>,
) -> re_viewer::external::re_types::DeserializationResult<Self>
where
Self: Sized,
{
unimplemented!()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we were able to compress the visual space of this somehow it wouldn't be too bad 🤔



# NOTE: This has to live here for now, while we migrate to archetypes (circular experimental imports).
def splat() -> Any:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would still appreciate calling this instance_key_splat to make it clear what we're splatting

@Wumpf Wumpf merged commit 4debe3f into main Jul 28, 2023
@Wumpf Wumpf deleted the cmc/goodbye_old_point branch July 28, 2023 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen/idl 🐍 Python API Python logging API 🦀 Rust API Rust logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate legacy Points{2|3}D
2 participants