-
Notifications
You must be signed in to change notification settings - Fork 451
Deprecate SeriesLine
/SeriesPoint
/Scalar
in favor of SeriesLines
/SeriesPoints
/Scalars
#9338
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
Merged
Merged
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
7d8d352
replace panic with proper error messages for some codegen paths
Wumpf 1355efe
fix handling arrays of enums in codegen
Wumpf 7a51c37
add pluralized versions of series line/points & scalar, deprecating s…
Wumpf c413849
remove experimental multi scalar demo, we have other demos & tests to…
Wumpf c2c3bd4
Update examples etc ...
Wumpf 467d2c7
add test to ensure that deprecated points & lines types work
Wumpf 11fd99f
rust doc fix
Wumpf e2c09b9
python doc gen fix
Wumpf db046de
add migration guide
Wumpf 36816b8
more rust doc fix
Wumpf 3c40b69
add back deprecated types to gen_common_index.py
Wumpf 6affb7c
Merge branch 'main' into andreas/pluralize-series-types
emilk e6075d5
fix typos
emilk 3f60ebb
Improve error message from `rerun rrd verify` command
emilk 06e1374
Migrate renamed archetypes and field names
emilk 04f240a
Remove explicit code to handle deprecated archetypes
emilk 3cdf51d
Convert `#[allow(deprecated)]` to `#[expect(deprecated)]`
emilk 10954ad
Exclude deprecated types from snippets INDEX.md
emilk 06f2a5e
Revert changes to old migration guide
emilk 9ec2e80
Comment on when the types were deprecated
emilk c3cb8c7
Remove unnecessary test
emilk 97339a3
Reorder some code
emilk e92afbe
Add back `visible_series` field for less breaking change
emilk 0d3beec
Add convenience constructor `Scalars::one`
emilk 0f49949
Mark all @classmethods as deprecated if the class is
emilk 2762c4d
Remove unused snapshot images
emilk 550cd34
Fix order of `@classmethod` and `@deprecated`
emilk 3d2d40b
Raise exceptions when calling deprecated functions
emilk 69153a6
Raise exceptions when calling deprecated functions
emilk ec36e42
Be strict when building examples
emilk 00edd61
Update examples to not use deprecated parameter
emilk 696dd35
Update examples from `Scalar` to `Scalars`
emilk 6a40f2d
`SeriesLine` -> `SeriesLines`
emilk ba5c483
SeriesPoint -> SeriesPoints
emilk 9008f69
Revert "Raise exceptions when calling deprecated functions"
emilk 64beb8f
Pluralize parameter names
emilk c283b81
2nd attempt
grtlr 824f844
py-fmt
emilk 55ec6bf
Merge branch 'grtlr/fix-graphs-color' into emilk/raise-on-warning
emilk 8a7d721
Merge branch 'emilk/raise-on-warning' into andreas/pluralize-series-t…
emilk 2c41a6f
Merge branch 'main' into andreas/pluralize-series-types
emilk 8b2268c
Make it an error to link to a deprecated object
emilk 763e7a0
Update doclinks to new objects
emilk df6ea45
rr.Scalar -> rr.Scalars
emilk 80e0f63
rr.SeriesLine -> rr.SeriesLines
emilk 3ea415b
Try to make it an error to use deprecated functions in C++… but failing
emilk a0634b8
More converting of old names into new
emilk c65fb86
Fix double word
emilk 881695f
Merge branch 'main' into andreas/pluralize-series-types
emilk a5e912b
compare_snippet_output.py: print all failures, not just the first one
emilk d93778f
Use proper colors in C++ snippets
emilk 0046eec
plural
emilk 526f55e
Fix `docs/snippets/all/archetypes/scalars_multiple_plots.cpp`
emilk 92972cc
codegen
emilk 3dc5b60
Mark new archetypes as unreleased
emilk 5242857
Merge branch 'main' into andreas/pluralize-series-types
emilk 4be1e0d
Opt-out of compare due to floating point differences
emilk 312f3fe
Merge branch 'main' into andreas/pluralize-series-types
emilk 14bddd5
Remove old reference from snippet
emilk c54f726
fix opt-out
emilk ae59cdf
Merge branch 'main' into andreas/pluralize-series-types
emilk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
//! Handles migrating old `re_types` to new ones. | ||
//! | ||
//! | ||
use std::collections::BTreeMap; | ||
|
||
use arrow::{ | ||
array::{ArrayRef as ArrowArrayRef, RecordBatch as ArrowRecordBatch, RecordBatchOptions}, | ||
datatypes::{Field as ArrowField, FieldRef as ArrowFieldRef, Schema as ArrowSchema}, | ||
}; | ||
|
||
/// Migrate old renamed types to new types. | ||
pub fn migrate_record_batch(batch: &ArrowRecordBatch) -> ArrowRecordBatch { | ||
re_tracing::profile_function!(); | ||
|
||
struct ArchetypeRename { | ||
new_name: &'static str, | ||
field_renames: BTreeMap<&'static str, &'static str>, | ||
} | ||
|
||
let archetype_renames = BTreeMap::from([ | ||
( | ||
"rerun.archetypes.Scalar", | ||
ArchetypeRename { | ||
new_name: "rerun.archetypes.Scalars", | ||
field_renames: [("scalar", "scalars")].into(), | ||
}, | ||
), | ||
( | ||
"rerun.archetypes.SeriesLine", | ||
ArchetypeRename { | ||
new_name: "rerun.archetypes.SeriesLines", | ||
field_renames: [("color", "colors"), ("width", "widths"), ("name", "names")].into(), | ||
}, | ||
), | ||
( | ||
"rerun.archetypes.SeriesPoint", | ||
ArchetypeRename { | ||
new_name: "rerun.archetypes.SeriesPoints", | ||
field_renames: [ | ||
("color", "colors"), | ||
("marker", "markers"), | ||
("name", "names"), | ||
("marker_size", "marker_sizes"), | ||
] | ||
.into(), | ||
}, | ||
), | ||
]); | ||
|
||
let num_columns = batch.num_columns(); | ||
let mut fields: Vec<ArrowFieldRef> = Vec::with_capacity(num_columns); | ||
let mut columns: Vec<ArrowArrayRef> = Vec::with_capacity(num_columns); | ||
|
||
for (field, array) in itertools::izip!(batch.schema().fields(), batch.columns()) { | ||
let mut metadata = field.metadata().clone(); | ||
if let Some(archetype) = metadata.get_mut("rerun.archetype") { | ||
if let Some(archetype_rename) = archetype_renames.get(archetype.as_str()) { | ||
re_log::debug_once!( | ||
"Migrating {archetype:?} to {:?}…", | ||
archetype_rename.new_name | ||
); | ||
|
||
// Rename archetype: | ||
*archetype = archetype_rename.new_name.to_owned(); | ||
|
||
// Renmame fields: | ||
if let Some(archetype_field) = metadata.get_mut("rerun.archetype_field") { | ||
if let Some(new_field_name) = | ||
archetype_rename.field_renames.get(archetype_field.as_str()) | ||
{ | ||
*archetype_field = (*new_field_name).to_owned(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
let field = ArrowField::clone(field.as_ref()) | ||
.clone() | ||
.with_metadata(metadata); | ||
|
||
fields.push(field.into()); | ||
columns.push(array.clone()); | ||
} | ||
|
||
let schema = ArrowSchema::new_with_metadata(fields, batch.schema().metadata.clone()); | ||
|
||
ArrowRecordBatch::try_new_with_options( | ||
schema.into(), | ||
columns, | ||
&RecordBatchOptions::default().with_row_count(Some(batch.num_rows())), | ||
) | ||
.expect("Can't fail") | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 7 additions & 8 deletions
15
crates/store/re_types/definitions/rerun/archetypes/scalar.fbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
crates/store/re_types/definitions/rerun/archetypes/scalars.fbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace rerun.archetypes; | ||
|
||
/// One or more double-precision scalar values, e.g. for use for time-series plots. | ||
/// | ||
/// The current timeline value will be used for the time/X-axis, hence scalars | ||
/// should not be static. | ||
/// Number of scalars per timestamp is expected to be the same over time. | ||
/// | ||
/// When used to produce a plot, this archetype is used to provide the data that | ||
/// is referenced by [archetypes.SeriesLines] or [archetypes.SeriesPoints]. You can do | ||
/// this by logging both archetypes to the same path, or alternatively configuring | ||
/// the plot-specific archetypes through the blueprint. | ||
/// | ||
/// \example archetypes/scalars_simple !api title="Simple line plot" image="https://static.rerun.io/scalar_simple/8bcc92f56268739f8cd24d60d1fe72a655f62a46/1200w.png" | ||
/// \example archetypes/scalars_multiple_plots !api title="Multiple time series plots" image="https://static.rerun.io/scalar_multiple/15845c2a348f875248fbd694e03eabd922741c4c/1200w.png" | ||
/// \example archetypes/scalars_row_updates title="Update a scalar over time" image="https://static.rerun.io/transform3d_column_updates/2b7ccfd29349b2b107fcf7eb8a1291a92cf1cafc/1200w.png" | ||
/// \example archetypes/scalars_column_updates title="Update a scalar over time, in a single operation" image="https://static.rerun.io/transform3d_column_updates/2b7ccfd29349b2b107fcf7eb8a1291a92cf1cafc/1200w.png" | ||
table Scalars ( | ||
"attr.docs.unreleased", | ||
"attr.rust.derive": "PartialEq", | ||
"attr.docs.category": "Plotting", | ||
"attr.docs.view_types": "TimeSeriesView" | ||
) { | ||
// --- Required --- | ||
|
||
/// The scalar values to log. | ||
scalars: [rerun.components.Scalar] ("attr.rerun.component_required", order: 1000); | ||
|
||
// --- Recommended --- | ||
|
||
// --- Optional --- | ||
|
||
// TODO(#1289): Support labeling points. | ||
} |
1 change: 0 additions & 1 deletion
1
crates/store/re_types/definitions/rerun/archetypes/segmentation_image.fbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
crates/store/re_types/definitions/rerun/archetypes/series_line.fbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
crates/store/re_types/definitions/rerun/archetypes/series_lines.fbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
namespace rerun.archetypes; | ||
|
||
/// Define the style properties for one or more line series in a chart. | ||
/// | ||
/// This archetype only provides styling information. | ||
/// Changes over time are supported for most but not all its fields (see respective fields for details), | ||
/// it's generally recommended to log this type as static. | ||
/// | ||
/// The underlying data needs to be logged to the same entity-path using [archetypes.Scalars]. | ||
/// Dimensionality of the scalar arrays logged at each time point is assumed to be the same over time. | ||
/// | ||
/// \example archetypes/series_lines_style title="Line series" image="https://static.rerun.io/series_line_style/d2616d98b1e46bdb85849b8669154fdf058e3453/1200w.png" | ||
table SeriesLines ( | ||
"attr.docs.unreleased", | ||
"attr.docs.category": "Plotting", | ||
"attr.docs.view_types": "TimeSeriesView" | ||
) { | ||
// --- Required --- | ||
|
||
// --- Optional --- | ||
|
||
// TODO(#8368, #9334): Once it's trivial to override how scalars for a plot are sourced, | ||
// we should make it explicit that the `SeriesLines`/`SeriesPoints` visualizers require | ||
// scalars as an input. | ||
// Doing so right now would break the model of how time series logging works too much: | ||
// This is a case where we want to encourage data <-> styling separation more than elsewhere, | ||
// so it's important to make keeping it separate easy. | ||
//scalars: [rerun.components.Scalar]; | ||
|
||
/// Color for the corresponding series. | ||
/// | ||
/// May change over time, but can cause discontinuities in the line. | ||
colors: [rerun.components.Color] ("attr.rerun.component_optional", nullable, order: 1000); | ||
|
||
/// Stroke width for the corresponding series. | ||
/// | ||
/// May change over time, but can cause discontinuities in the line. | ||
widths: [rerun.components.StrokeWidth] ("attr.rerun.component_optional", nullable, order: 2000); | ||
|
||
/// Display name of the series. | ||
/// | ||
/// Used in the legend. Expected to be unchanging over time. | ||
names: [rerun.components.Name] ("attr.rerun.component_optional", nullable, order: 3000); | ||
|
||
/// Which lines are visible. | ||
/// | ||
/// If not set, all line series on this entity are visible. | ||
/// Unlike with the regular visibility property of the entire entity, any series that is hidden | ||
/// via this property will still be visible in the legend. | ||
/// | ||
/// May change over time, but can cause discontinuities in the line. | ||
visible_series: [rerun.components.SeriesVisible] ("attr.rerun.component_optional", nullable, order: 3100); | ||
|
||
/// Configures the zoom-dependent scalar aggregation. | ||
/// | ||
/// This is done only if steps on the X axis go below a single pixel, | ||
/// i.e. a single pixel covers more than one tick worth of data. It can greatly improve performance | ||
/// (and readability) in such situations as it prevents overdraw. | ||
/// | ||
/// Expected to be unchanging over time. | ||
aggregation_policy: rerun.components.AggregationPolicy ("attr.rerun.component_optional", nullable, order: 4000); | ||
} |
7 changes: 3 additions & 4 deletions
7
crates/store/re_types/definitions/rerun/archetypes/series_point.fbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should mandate that we include when this was deprecated ("Deprecated since Rerun 0.23").