Skip to content

Commit

Permalink
Mark TimeSeriesScalar as deprecated in all SDKs and documentation (#5102
Browse files Browse the repository at this point in the history
)

### What

Our codegen can now deprecate archetypes
* Fixes #4830
* Does *not* address #2366
   * builtin attribute is for fields. Unclear if it can have text? 
   * Fixes #2367

### 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 the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5102/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5102/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5102/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5102)
- [Docs
preview](https://rerun.io/preview/b773eee58d95201fc1f16a023183294d739cf2f9/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/b773eee58d95201fc1f16a023183294d739cf2f9/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

---------

Co-authored-by: Jeremy Leibs <jeremy@rerun.io>
  • Loading branch information
Wumpf and jleibs authored Feb 8, 2024
1 parent 3192680 commit 52461cc
Show file tree
Hide file tree
Showing 37 changed files with 7,583 additions and 8,381 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto_release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: Install dependencies
shell: bash
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/contrib_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,14 @@ jobs:
run: |
pip install -r rerun_py/requirements-lint.txt
- name: Codegen
uses: actions-rs/cargo@v1
- uses: prefix-dev/setup-pixi@v0.4.1
with:
command: codegen
args: --force --check
pixi-version: v0.13.0

- name: Codegen check
shell: bash
run: |
pixi run codegen --force --check
rs-lints:
name: Rust lints (fmt, check, cranky, tests, doc)
Expand Down Expand Up @@ -208,7 +211,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- run: pixi run lint-taplo
shell: bash
Expand Down Expand Up @@ -296,7 +299,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

# TODO(emilk): make this work somehow. Right now this just results in
# > Compiler: GNU 12.3.0 (/__w/rerun/rerun/.pixi/env/bin/x86_64-conda-linux-gnu-c++)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/contrib_rerun_py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

# These should already be in the docker container, but run for good measure. A no-op install
# should be fast, and this way things don't break if we add new packages without rebuilding
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: Update crate versions
id: versioning
Expand Down Expand Up @@ -399,7 +399,7 @@ jobs:
- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- run: pixi run toml-fmt
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_build_and_upload_rerun_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: Build web-viewer
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_build_and_upload_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: Install dependencies
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_build_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: Download Wheel
uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_build_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: Build web-viewer (release)
shell: bash
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,14 @@ jobs:
run: |
pip install -r rerun_py/requirements-lint.txt
- name: Codegen
uses: actions-rs/cargo@v1
- uses: prefix-dev/setup-pixi@v0.4.1
with:
command: codegen
args: --force --check
pixi-version: v0.13.0

- name: Codegen check
shell: bash
run: |
pixi run codegen --force --check
rs-lints:
name: Rust lints (fmt, check, cranky, tests, doc)
Expand Down Expand Up @@ -229,7 +232,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: Taplo check
shell: bash
Expand Down Expand Up @@ -342,7 +345,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: prettier --check
run: pixi run misc-fmt-check
2 changes: 1 addition & 1 deletion .github/workflows/reusable_checks_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: Set up Rust
uses: ./.github/actions/setup-rust
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: Doxygen C++ docs
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_publish_npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.3.0
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: Publish packages
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_publish_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

# built by `reusable_build_and_publish_wheels`
- name: Download Wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

- name: Build web-viewer
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_test_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:

- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0
pixi-version: v0.13.0

# The pip-cache setup logic doesn't work in the ubuntu docker container
# That's probably fine since we bake these deps into the container already
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ if(DEFINED ENV{RERUN_SET_CXX_VERSION})
endif()

# ------------------------------------------------------------------------------

function(rerun_strict_warning_settings target)
if(MSVC)
# TODO(andreas): Try to enable /Wall
Expand Down Expand Up @@ -85,6 +84,7 @@ function(rerun_strict_warning_settings target)
-Wno-unreachable-code-break # TODO(emilk): remove this exception - we only need this because of codegen
-Wno-unreachable-code-return # TODO(emilk): remove this exception - we only need this because of codegen
-Wno-unused-macros
-Wno-unsafe-buffer-usage # There's a few helper ctors that run into this.
)
endif()

Expand Down
5 changes: 2 additions & 3 deletions crates/re_data_store/benches/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ fn plotting_dashboard(c: &mut Criterion) {
.into()
};

let mut datagen = |i| {
Box::new(re_types::archetypes::TimeSeriesScalar::new(i as f64)) as Box<dyn AsComponents>
};
let mut datagen =
|i| Box::new(re_types::archetypes::Scalar::new(i as f64)) as Box<dyn AsComponents>;

// Default config
group.bench_function("default", |b| {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use itertools::Itertools;
use re_query_cache::QueryError;
use re_types::{
archetypes::TimeSeriesScalar,
components::{Color, Radius, Scalar, ScalarScattering, Text},
Archetype, Loggable,
};
Expand All @@ -16,6 +15,9 @@ use crate::{
PlotPoint, PlotPointAttrs, PlotSeries, PlotSeriesKind, ScatterAttrs,
};

#[allow(deprecated)]
use re_types::archetypes::TimeSeriesScalar;

/// The legacy system for rendering [`TimeSeriesScalar`] archetypes.
#[derive(Default, Debug)]
pub struct LegacyTimeSeriesSystem {
Expand All @@ -30,6 +32,7 @@ impl IdentifiedViewSystem for LegacyTimeSeriesSystem {
}

impl VisualizerSystem for LegacyTimeSeriesSystem {
#[allow(deprecated)]
fn visualizer_query_info(&self) -> VisualizerQueryInfo {
let mut query_info = VisualizerQueryInfo::from_archetype::<TimeSeriesScalar>();
// Although we don't normally include indicator components in required components,
Expand Down Expand Up @@ -85,6 +88,7 @@ impl VisualizerSystem for LegacyTimeSeriesSystem {
}

impl LegacyTimeSeriesSystem {
#[allow(deprecated)]
fn load_scalars(
&mut self,
ctx: &ViewerContext<'_>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include "fbs/attributes.fbs";

include "rerun/attributes.fbs";
include "rerun/datatypes.fbs";
include "rerun/components.fbs";

Expand All @@ -22,6 +23,7 @@ namespace rerun.archetypes;
/// \example scalar_simple title="Simple line plot" image="https://static.rerun.io/scalar_simple/8bcc92f56268739f8cd24d60d1fe72a655f62a46/1200w.png"
/// \example scalar_multiple_plots !api title="Multiple time series plots" image="https://static.rerun.io/scalar_multiple/15845c2a348f875248fbd694e03eabd922741c4c/1200w.png"
table TimeSeriesScalar (
"attr.rerun.deprecated": "Use the `Scalar` + (optional) `SeriesLine`/`SeriesPoint` archetypes instead, logged on the same entity.",
"attr.rust.derive": "PartialEq"
) {
// --- Required ---
Expand Down
10 changes: 10 additions & 0 deletions crates/re_types/definitions/rerun/attributes.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ attribute "attr.rerun.override_type";
///
/// This is used for example to scope blueprint types.
attribute "attr.rerun.scope";

/// Marks something as deprecated followed by a (mandatory!) migration note.
///
/// If specified on an object (struct/enum/union), it becomes deprecated such
/// that using the object should emit a warning in all target languages.
/// Furthermore, documentation will mention that the object is deprecated and display
/// the specified migration note.
///
/// TODO(andreas): This is not yet supported on fields.
attribute "attr.rerun.deprecated";
4 changes: 3 additions & 1 deletion crates/re_types/src/archetypes/mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions crates/re_types/src/archetypes/time_series_scalar.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 52461cc

Please sign in to comment.