From c796f2f49400bb88070ca4f020c43d724af92983 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 6 Jul 2023 13:15:17 +0200 Subject: [PATCH] codegen --- crates/re_types/source_hash.txt | 2 +- crates/re_types/src/archetypes/fuzzy.rs | 2146 +++++++++-------- crates/re_types/src/archetypes/points2d.rs | 479 ++-- crates/re_types/src/components/fuzzy.rs | 280 +-- crates/re_types/src/datatypes/fuzzy.rs | 134 +- .../rerun/_rerun2/archetypes/fuzzy.py | 130 +- .../rerun/_rerun2/archetypes/points2d.py | 35 +- .../rerun/_rerun2/components/fuzzy.py | 30 +- .../rerun/_rerun2/datatypes/fuzzy.py | 21 +- 9 files changed, 1728 insertions(+), 1529 deletions(-) diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index 00a004d710ee0..2faade6d30811 100644 --- a/crates/re_types/source_hash.txt +++ b/crates/re_types/source_hash.txt @@ -1,4 +1,4 @@ # This is a sha256 hash for all direct and indirect dependencies of this crate's build script. # It can be safely removed at anytime to force the build script to run again. # Check out build.rs to see how it's computed. -91c9432b65ab14523d139e5f45c426f64a761e013b8a3edeb609b6439ee9273d \ No newline at end of file +9b0a1871f73c5ebc4bdfd0a82fea12df266d4cfd6a6f4504b21bbe58ad4ce838 \ No newline at end of file diff --git a/crates/re_types/src/archetypes/fuzzy.rs b/crates/re_types/src/archetypes/fuzzy.rs index 29b9f74041a33..22609bed9f1b8 100644 --- a/crates/re_types/src/archetypes/fuzzy.rs +++ b/crates/re_types/src/archetypes/fuzzy.rs @@ -37,32 +37,32 @@ pub struct AffixFuzzer1 { pub fuzz1111: Vec, pub fuzz1112: Vec, pub fuzz1113: Vec, - pub fuzz2001: crate::components::AffixFuzzer1, - pub fuzz2002: crate::components::AffixFuzzer2, - pub fuzz2003: crate::components::AffixFuzzer3, - pub fuzz2004: crate::components::AffixFuzzer4, - pub fuzz2005: crate::components::AffixFuzzer5, - pub fuzz2006: crate::components::AffixFuzzer6, - pub fuzz2007: crate::components::AffixFuzzer7, - pub fuzz2008: crate::components::AffixFuzzer8, - pub fuzz2009: crate::components::AffixFuzzer9, - pub fuzz2010: crate::components::AffixFuzzer10, - pub fuzz2011: crate::components::AffixFuzzer11, - pub fuzz2012: crate::components::AffixFuzzer12, - pub fuzz2013: crate::components::AffixFuzzer13, - pub fuzz2101: Vec, - pub fuzz2102: Vec, - pub fuzz2103: Vec, - pub fuzz2104: Vec, - pub fuzz2105: Vec, - pub fuzz2106: Vec, - pub fuzz2107: Vec, - pub fuzz2108: Vec, - pub fuzz2109: Vec, - pub fuzz2110: Vec, - pub fuzz2111: Vec, - pub fuzz2112: Vec, - pub fuzz2113: Vec, + pub fuzz2001: Option, + pub fuzz2002: Option, + pub fuzz2003: Option, + pub fuzz2004: Option, + pub fuzz2005: Option, + pub fuzz2006: Option, + pub fuzz2007: Option, + pub fuzz2008: Option, + pub fuzz2009: Option, + pub fuzz2010: Option, + pub fuzz2011: Option, + pub fuzz2012: Option, + pub fuzz2013: Option, + pub fuzz2101: Option>, + pub fuzz2102: Option>, + pub fuzz2103: Option>, + pub fuzz2104: Option>, + pub fuzz2105: Option>, + pub fuzz2106: Option>, + pub fuzz2107: Option>, + pub fuzz2108: Option>, + pub fuzz2109: Option>, + pub fuzz2110: Option>, + pub fuzz2111: Option>, + pub fuzz2112: Option>, + pub fuzz2113: Option>, } impl AffixFuzzer1 { @@ -688,875 +688,533 @@ impl crate::Archetype for AffixFuzzer1 { .transpose()? }, { - Some({ - let array = - ::try_to_arrow([&self.fuzz2001], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer1".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer1".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2001", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2002], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer2".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer2".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2002", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2003], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer3".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer3".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2003", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2004], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer4".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer4".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2004", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2005], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer5".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer5".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2005", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2006], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer6".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer6".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2006", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2007], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer7".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer7".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2007", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2008], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer8".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer8".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2008", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2009], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer9".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer9".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2009", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2010], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer10".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer10".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2010", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2011], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer11".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer11".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2011", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2012], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer12".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer12".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2012", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2013], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer13".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer13".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2013", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2101.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer1".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer1".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2101", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2102.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer2".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer2".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2102", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2103.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer3".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer3".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2103", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2104.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer4".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer4".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2104", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2105.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer5".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer5".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2105", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2106.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer6".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer6".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2106", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2107.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer7".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer7".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2107", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2108.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer8".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer8".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2108", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2109.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer9".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer9".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2109", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = ::try_to_arrow( - self.fuzz2110.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer10".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer10".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2110", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = ::try_to_arrow( - self.fuzz2111.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer11".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer11".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2111", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = ::try_to_arrow( - self.fuzz2112.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer12".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer12".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2112", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = ::try_to_arrow( - self.fuzz2113.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer13".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer13".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2113", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - ] - .into_iter() - .flatten() - .collect()) - } - - #[inline] - fn try_from_arrow( - data: impl IntoIterator)>, - ) -> crate::DeserializationResult { - use crate::Component as _; - let arrays_by_name: ::std::collections::HashMap<_, _> = data - .into_iter() - .map(|(field, array)| (field.name, array)) - .collect(); - let fuzz1001 = { - let array = arrays_by_name.get("fuzz1001").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1002 = { - let array = arrays_by_name.get("fuzz1002").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1003 = { - let array = arrays_by_name.get("fuzz1003").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1004 = { - let array = arrays_by_name.get("fuzz1004").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1005 = { - let array = arrays_by_name.get("fuzz1005").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1006 = { - let array = arrays_by_name.get("fuzz1006").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1007 = { - let array = arrays_by_name.get("fuzz1007").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1008 = { - let array = arrays_by_name.get("fuzz1008").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1009 = { - let array = arrays_by_name.get("fuzz1009").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1010 = { - let array = arrays_by_name.get("fuzz1010").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1011 = { - let array = arrays_by_name.get("fuzz1011").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1012 = { - let array = arrays_by_name.get("fuzz1012").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1013 = { - let array = arrays_by_name.get("fuzz1013").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1101 = { - let array = arrays_by_name.get("fuzz1101").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1102 = { - let array = arrays_by_name.get("fuzz1102").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1103 = { - let array = arrays_by_name.get("fuzz1103").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1104 = { - let array = arrays_by_name.get("fuzz1104").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1105 = { - let array = arrays_by_name.get("fuzz1105").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1106 = { - let array = arrays_by_name.get("fuzz1106").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1107 = { - let array = arrays_by_name.get("fuzz1107").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1108 = { - let array = arrays_by_name.get("fuzz1108").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1109 = { - let array = arrays_by_name.get("fuzz1109").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1110 = { - let array = arrays_by_name.get("fuzz1110").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1111 = { - let array = arrays_by_name.get("fuzz1111").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1112 = { - let array = arrays_by_name.get("fuzz1112").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1113 = { - let array = arrays_by_name.get("fuzz1113").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz2001 = { - let array = arrays_by_name.get("fuzz2001").ok_or_else(|| { + self.fuzz2001 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer1".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer1".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2001", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2002 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer2".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer2".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2002", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2003 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer3".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer3".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2003", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2004 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer4".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer4".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2004", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2005 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer5".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer5".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2005", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2006 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer6".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer6".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2006", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2007 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer7".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer7".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2007", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2008 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer8".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer8".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2008", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2009 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer9".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer9".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2009", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2010 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer10".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer10".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2010", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2011 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer11".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer11".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2011", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2012 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer12".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer12".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2012", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2013 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer13".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer13".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2013", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2101 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer1".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer1".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2101", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2102 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer2".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer2".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2102", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2103 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer3".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer3".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2103", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2104 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer4".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer4".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2104", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2105 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer5".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer5".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2105", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2106 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer6".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer6".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2106", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2107 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer7".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer7".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2107", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2108 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer8".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer8".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2108", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2109 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer9".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer9".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2109", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2110 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer10".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer10".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2110", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2111 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer11".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer11".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2111", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2112 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer12".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer12".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2112", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2113 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer13".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer13".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2113", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + ] + .into_iter() + .flatten() + .collect()) + } + + #[inline] + fn try_from_arrow( + data: impl IntoIterator)>, + ) -> crate::DeserializationResult { + use crate::Component as _; + let arrays_by_name: ::std::collections::HashMap<_, _> = data + .into_iter() + .map(|(field, array)| (field.name, array)) + .collect(); + let fuzz1001 = { + let array = arrays_by_name.get("fuzz1001").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1569,8 +1227,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2002 = { - let array = arrays_by_name.get("fuzz2002").ok_or_else(|| { + let fuzz1002 = { + let array = arrays_by_name.get("fuzz1002").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1583,8 +1241,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2003 = { - let array = arrays_by_name.get("fuzz2003").ok_or_else(|| { + let fuzz1003 = { + let array = arrays_by_name.get("fuzz1003").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1597,8 +1255,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2004 = { - let array = arrays_by_name.get("fuzz2004").ok_or_else(|| { + let fuzz1004 = { + let array = arrays_by_name.get("fuzz1004").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1611,8 +1269,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2005 = { - let array = arrays_by_name.get("fuzz2005").ok_or_else(|| { + let fuzz1005 = { + let array = arrays_by_name.get("fuzz1005").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1625,8 +1283,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2006 = { - let array = arrays_by_name.get("fuzz2006").ok_or_else(|| { + let fuzz1006 = { + let array = arrays_by_name.get("fuzz1006").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1639,8 +1297,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2007 = { - let array = arrays_by_name.get("fuzz2007").ok_or_else(|| { + let fuzz1007 = { + let array = arrays_by_name.get("fuzz1007").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1653,8 +1311,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2008 = { - let array = arrays_by_name.get("fuzz2008").ok_or_else(|| { + let fuzz1008 = { + let array = arrays_by_name.get("fuzz1008").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1667,8 +1325,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2009 = { - let array = arrays_by_name.get("fuzz2009").ok_or_else(|| { + let fuzz1009 = { + let array = arrays_by_name.get("fuzz1009").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1681,8 +1339,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2010 = { - let array = arrays_by_name.get("fuzz2010").ok_or_else(|| { + let fuzz1010 = { + let array = arrays_by_name.get("fuzz1010").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1695,8 +1353,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2011 = { - let array = arrays_by_name.get("fuzz2011").ok_or_else(|| { + let fuzz1011 = { + let array = arrays_by_name.get("fuzz1011").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1709,8 +1367,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2012 = { - let array = arrays_by_name.get("fuzz2012").ok_or_else(|| { + let fuzz1012 = { + let array = arrays_by_name.get("fuzz1012").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1723,8 +1381,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2013 = { - let array = arrays_by_name.get("fuzz2013").ok_or_else(|| { + let fuzz1013 = { + let array = arrays_by_name.get("fuzz1013").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1737,8 +1395,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2101 = { - let array = arrays_by_name.get("fuzz2101").ok_or_else(|| { + let fuzz1101 = { + let array = arrays_by_name.get("fuzz1101").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1752,8 +1410,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2102 = { - let array = arrays_by_name.get("fuzz2102").ok_or_else(|| { + let fuzz1102 = { + let array = arrays_by_name.get("fuzz1102").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1767,8 +1425,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2103 = { - let array = arrays_by_name.get("fuzz2103").ok_or_else(|| { + let fuzz1103 = { + let array = arrays_by_name.get("fuzz1103").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1782,8 +1440,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2104 = { - let array = arrays_by_name.get("fuzz2104").ok_or_else(|| { + let fuzz1104 = { + let array = arrays_by_name.get("fuzz1104").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1797,8 +1455,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2105 = { - let array = arrays_by_name.get("fuzz2105").ok_or_else(|| { + let fuzz1105 = { + let array = arrays_by_name.get("fuzz1105").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1812,8 +1470,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2106 = { - let array = arrays_by_name.get("fuzz2106").ok_or_else(|| { + let fuzz1106 = { + let array = arrays_by_name.get("fuzz1106").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1827,8 +1485,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2107 = { - let array = arrays_by_name.get("fuzz2107").ok_or_else(|| { + let fuzz1107 = { + let array = arrays_by_name.get("fuzz1107").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1842,8 +1500,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2108 = { - let array = arrays_by_name.get("fuzz2108").ok_or_else(|| { + let fuzz1108 = { + let array = arrays_by_name.get("fuzz1108").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1857,8 +1515,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2109 = { - let array = arrays_by_name.get("fuzz2109").ok_or_else(|| { + let fuzz1109 = { + let array = arrays_by_name.get("fuzz1109").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1872,8 +1530,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2110 = { - let array = arrays_by_name.get("fuzz2110").ok_or_else(|| { + let fuzz1110 = { + let array = arrays_by_name.get("fuzz1110").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1887,8 +1545,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2111 = { - let array = arrays_by_name.get("fuzz2111").ok_or_else(|| { + let fuzz1111 = { + let array = arrays_by_name.get("fuzz1111").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1902,8 +1560,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2112 = { - let array = arrays_by_name.get("fuzz2112").ok_or_else(|| { + let fuzz1112 = { + let array = arrays_by_name.get("fuzz1112").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1917,8 +1575,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2113 = { - let array = arrays_by_name.get("fuzz2113").ok_or_else(|| { + let fuzz1113 = { + let array = arrays_by_name.get("fuzz1113").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1932,6 +1590,357 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; + let fuzz2001 = if let Some(array) = arrays_by_name.get("fuzz2001") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2002 = if let Some(array) = arrays_by_name.get("fuzz2002") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2003 = if let Some(array) = arrays_by_name.get("fuzz2003") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2004 = if let Some(array) = arrays_by_name.get("fuzz2004") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2005 = if let Some(array) = arrays_by_name.get("fuzz2005") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2006 = if let Some(array) = arrays_by_name.get("fuzz2006") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2007 = if let Some(array) = arrays_by_name.get("fuzz2007") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2008 = if let Some(array) = arrays_by_name.get("fuzz2008") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2009 = if let Some(array) = arrays_by_name.get("fuzz2009") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2010 = if let Some(array) = arrays_by_name.get("fuzz2010") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2011 = if let Some(array) = arrays_by_name.get("fuzz2011") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2012 = if let Some(array) = arrays_by_name.get("fuzz2012") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2013 = if let Some(array) = arrays_by_name.get("fuzz2013") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2101 = if let Some(array) = arrays_by_name.get("fuzz2101") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2102 = if let Some(array) = arrays_by_name.get("fuzz2102") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2103 = if let Some(array) = arrays_by_name.get("fuzz2103") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2104 = if let Some(array) = arrays_by_name.get("fuzz2104") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2105 = if let Some(array) = arrays_by_name.get("fuzz2105") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2106 = if let Some(array) = arrays_by_name.get("fuzz2106") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2107 = if let Some(array) = arrays_by_name.get("fuzz2107") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2108 = if let Some(array) = arrays_by_name.get("fuzz2108") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2109 = if let Some(array) = arrays_by_name.get("fuzz2109") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2110 = if let Some(array) = arrays_by_name.get("fuzz2110") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2111 = if let Some(array) = arrays_by_name.get("fuzz2111") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2112 = if let Some(array) = arrays_by_name.get("fuzz2112") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2113 = if let Some(array) = arrays_by_name.get("fuzz2113") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; Ok(Self { fuzz1001, fuzz1002, @@ -2017,32 +2026,6 @@ impl AffixFuzzer1 { fuzz1111: impl IntoIterator>, fuzz1112: impl IntoIterator>, fuzz1113: impl IntoIterator>, - fuzz2001: impl Into, - fuzz2002: impl Into, - fuzz2003: impl Into, - fuzz2004: impl Into, - fuzz2005: impl Into, - fuzz2006: impl Into, - fuzz2007: impl Into, - fuzz2008: impl Into, - fuzz2009: impl Into, - fuzz2010: impl Into, - fuzz2011: impl Into, - fuzz2012: impl Into, - fuzz2013: impl Into, - fuzz2101: impl IntoIterator>, - fuzz2102: impl IntoIterator>, - fuzz2103: impl IntoIterator>, - fuzz2104: impl IntoIterator>, - fuzz2105: impl IntoIterator>, - fuzz2106: impl IntoIterator>, - fuzz2107: impl IntoIterator>, - fuzz2108: impl IntoIterator>, - fuzz2109: impl IntoIterator>, - fuzz2110: impl IntoIterator>, - fuzz2111: impl IntoIterator>, - fuzz2112: impl IntoIterator>, - fuzz2113: impl IntoIterator>, ) -> Self { Self { fuzz1001: fuzz1001.into(), @@ -2071,32 +2054,201 @@ impl AffixFuzzer1 { fuzz1111: fuzz1111.into_iter().map(Into::into).collect(), fuzz1112: fuzz1112.into_iter().map(Into::into).collect(), fuzz1113: fuzz1113.into_iter().map(Into::into).collect(), - fuzz2001: fuzz2001.into(), - fuzz2002: fuzz2002.into(), - fuzz2003: fuzz2003.into(), - fuzz2004: fuzz2004.into(), - fuzz2005: fuzz2005.into(), - fuzz2006: fuzz2006.into(), - fuzz2007: fuzz2007.into(), - fuzz2008: fuzz2008.into(), - fuzz2009: fuzz2009.into(), - fuzz2010: fuzz2010.into(), - fuzz2011: fuzz2011.into(), - fuzz2012: fuzz2012.into(), - fuzz2013: fuzz2013.into(), - fuzz2101: fuzz2101.into_iter().map(Into::into).collect(), - fuzz2102: fuzz2102.into_iter().map(Into::into).collect(), - fuzz2103: fuzz2103.into_iter().map(Into::into).collect(), - fuzz2104: fuzz2104.into_iter().map(Into::into).collect(), - fuzz2105: fuzz2105.into_iter().map(Into::into).collect(), - fuzz2106: fuzz2106.into_iter().map(Into::into).collect(), - fuzz2107: fuzz2107.into_iter().map(Into::into).collect(), - fuzz2108: fuzz2108.into_iter().map(Into::into).collect(), - fuzz2109: fuzz2109.into_iter().map(Into::into).collect(), - fuzz2110: fuzz2110.into_iter().map(Into::into).collect(), - fuzz2111: fuzz2111.into_iter().map(Into::into).collect(), - fuzz2112: fuzz2112.into_iter().map(Into::into).collect(), - fuzz2113: fuzz2113.into_iter().map(Into::into).collect(), + fuzz2001: None, + fuzz2002: None, + fuzz2003: None, + fuzz2004: None, + fuzz2005: None, + fuzz2006: None, + fuzz2007: None, + fuzz2008: None, + fuzz2009: None, + fuzz2010: None, + fuzz2011: None, + fuzz2012: None, + fuzz2013: None, + fuzz2101: None, + fuzz2102: None, + fuzz2103: None, + fuzz2104: None, + fuzz2105: None, + fuzz2106: None, + fuzz2107: None, + fuzz2108: None, + fuzz2109: None, + fuzz2110: None, + fuzz2111: None, + fuzz2112: None, + fuzz2113: None, } } + + pub fn with_fuzz2001(mut self, fuzz2001: impl Into) -> Self { + self.fuzz2001 = Some(fuzz2001.into()); + self + } + + pub fn with_fuzz2002(mut self, fuzz2002: impl Into) -> Self { + self.fuzz2002 = Some(fuzz2002.into()); + self + } + + pub fn with_fuzz2003(mut self, fuzz2003: impl Into) -> Self { + self.fuzz2003 = Some(fuzz2003.into()); + self + } + + pub fn with_fuzz2004(mut self, fuzz2004: impl Into) -> Self { + self.fuzz2004 = Some(fuzz2004.into()); + self + } + + pub fn with_fuzz2005(mut self, fuzz2005: impl Into) -> Self { + self.fuzz2005 = Some(fuzz2005.into()); + self + } + + pub fn with_fuzz2006(mut self, fuzz2006: impl Into) -> Self { + self.fuzz2006 = Some(fuzz2006.into()); + self + } + + pub fn with_fuzz2007(mut self, fuzz2007: impl Into) -> Self { + self.fuzz2007 = Some(fuzz2007.into()); + self + } + + pub fn with_fuzz2008(mut self, fuzz2008: impl Into) -> Self { + self.fuzz2008 = Some(fuzz2008.into()); + self + } + + pub fn with_fuzz2009(mut self, fuzz2009: impl Into) -> Self { + self.fuzz2009 = Some(fuzz2009.into()); + self + } + + pub fn with_fuzz2010(mut self, fuzz2010: impl Into) -> Self { + self.fuzz2010 = Some(fuzz2010.into()); + self + } + + pub fn with_fuzz2011(mut self, fuzz2011: impl Into) -> Self { + self.fuzz2011 = Some(fuzz2011.into()); + self + } + + pub fn with_fuzz2012(mut self, fuzz2012: impl Into) -> Self { + self.fuzz2012 = Some(fuzz2012.into()); + self + } + + pub fn with_fuzz2013(mut self, fuzz2013: impl Into) -> Self { + self.fuzz2013 = Some(fuzz2013.into()); + self + } + + pub fn with_fuzz2101( + mut self, + fuzz2101: impl IntoIterator>, + ) -> Self { + self.fuzz2101 = Some(fuzz2101.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2102( + mut self, + fuzz2102: impl IntoIterator>, + ) -> Self { + self.fuzz2102 = Some(fuzz2102.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2103( + mut self, + fuzz2103: impl IntoIterator>, + ) -> Self { + self.fuzz2103 = Some(fuzz2103.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2104( + mut self, + fuzz2104: impl IntoIterator>, + ) -> Self { + self.fuzz2104 = Some(fuzz2104.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2105( + mut self, + fuzz2105: impl IntoIterator>, + ) -> Self { + self.fuzz2105 = Some(fuzz2105.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2106( + mut self, + fuzz2106: impl IntoIterator>, + ) -> Self { + self.fuzz2106 = Some(fuzz2106.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2107( + mut self, + fuzz2107: impl IntoIterator>, + ) -> Self { + self.fuzz2107 = Some(fuzz2107.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2108( + mut self, + fuzz2108: impl IntoIterator>, + ) -> Self { + self.fuzz2108 = Some(fuzz2108.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2109( + mut self, + fuzz2109: impl IntoIterator>, + ) -> Self { + self.fuzz2109 = Some(fuzz2109.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2110( + mut self, + fuzz2110: impl IntoIterator>, + ) -> Self { + self.fuzz2110 = Some(fuzz2110.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2111( + mut self, + fuzz2111: impl IntoIterator>, + ) -> Self { + self.fuzz2111 = Some(fuzz2111.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2112( + mut self, + fuzz2112: impl IntoIterator>, + ) -> Self { + self.fuzz2112 = Some(fuzz2112.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2113( + mut self, + fuzz2113: impl IntoIterator>, + ) -> Self { + self.fuzz2113 = Some(fuzz2113.into_iter().map(Into::into).collect()); + self + } } diff --git a/crates/re_types/src/archetypes/points2d.rs b/crates/re_types/src/archetypes/points2d.rs index 33041a32497da..57db44037fdb6 100644 --- a/crates/re_types/src/archetypes/points2d.rs +++ b/crates/re_types/src/archetypes/points2d.rs @@ -46,24 +46,24 @@ pub struct Points2D { pub points: Vec, #[doc = "Optional radii for the points, effectively turning them into circles."] - pub radii: Vec, + pub radii: Option>, #[doc = "Optional colors for the points."] - pub colors: Vec, + pub colors: Option>, #[doc = "Optional text labels for the points."] - pub labels: Vec, + pub labels: Option>, #[doc = "An optional floating point value that specifies the 2D drawing order."] #[doc = "Objects with higher values are drawn on top of those with lower values."] #[doc = ""] #[doc = "The default for 2D points is 30.0."] - pub draw_order: crate::components::DrawOrder, + pub draw_order: Option, #[doc = "Optional class Ids for the points."] #[doc = ""] #[doc = "The class ID provides colors and labels if not specified explicitly."] - pub class_ids: Vec, + pub class_ids: Option>, #[doc = "Optional keypoint IDs for the points, identifying them within a class."] #[doc = ""] @@ -73,10 +73,10 @@ pub struct Points2D { #[doc = "with `class_id`)."] #[doc = "E.g. the classification might be 'Person' and the keypoints refer to joints on a"] #[doc = "detected skeleton."] - pub keypoint_ids: Vec, + pub keypoint_ids: Option>, #[doc = "Unique identifiers for each individual point in the batch."] - pub instance_keys: Vec, + pub instance_keys: Option>, } impl Points2D { @@ -156,131 +156,139 @@ impl crate::Archetype for Points2D { .transpose()? }, { - Some({ - let array = ::try_to_arrow(self.radii.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.Radius".into(), - Box::new(array.data_type().clone()), - Some("rerun.radius".into()), - ); - ( - ::arrow2::datatypes::Field::new("radii", datatype, false), - array, - ) + self.radii + .as_ref() + .map(|many| { + let array = ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.Radius".into(), + Box::new(array.data_type().clone()), + Some("rerun.radius".into()), + ); + ( + ::arrow2::datatypes::Field::new("radii", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = ::try_to_arrow(self.colors.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.Color".into(), - Box::new(array.data_type().clone()), - Some("rerun.colorrgba".into()), - ); - ( - ::arrow2::datatypes::Field::new("colors", datatype, false), - array, - ) + self.colors + .as_ref() + .map(|many| { + let array = ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.Color".into(), + Box::new(array.data_type().clone()), + Some("rerun.colorrgba".into()), + ); + ( + ::arrow2::datatypes::Field::new("colors", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = ::try_to_arrow(self.labels.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.Label".into(), - Box::new(array.data_type().clone()), - Some("rerun.label".into()), - ); - ( - ::arrow2::datatypes::Field::new("labels", datatype, false), - array, - ) + self.labels + .as_ref() + .map(|many| { + let array = ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.Label".into(), + Box::new(array.data_type().clone()), + Some("rerun.label".into()), + ); + ( + ::arrow2::datatypes::Field::new("labels", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = - ::try_to_arrow([&self.draw_order], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.DrawOrder".into(), - Box::new(array.data_type().clone()), - Some("rerun.draw_order".into()), - ); - ( - ::arrow2::datatypes::Field::new("draw_order", datatype, false), - array, - ) + self.draw_order + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.DrawOrder".into(), + Box::new(array.data_type().clone()), + Some("rerun.draw_order".into()), + ); + ( + ::arrow2::datatypes::Field::new("draw_order", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = - ::try_to_arrow(self.class_ids.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.ClassId".into(), - Box::new(array.data_type().clone()), - Some("rerun.class_id".into()), - ); - ( - ::arrow2::datatypes::Field::new("class_ids", datatype, false), - array, - ) + self.class_ids + .as_ref() + .map(|many| { + let array = ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.ClassId".into(), + Box::new(array.data_type().clone()), + Some("rerun.class_id".into()), + ); + ( + ::arrow2::datatypes::Field::new("class_ids", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = ::try_to_arrow( - self.keypoint_ids.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.KeypointId".into(), - Box::new(array.data_type().clone()), - Some("rerun.keypoint_id".into()), - ); - ( - ::arrow2::datatypes::Field::new("keypoint_ids", datatype, false), - array, - ) + self.keypoint_ids + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.KeypointId".into(), + Box::new(array.data_type().clone()), + Some("rerun.keypoint_id".into()), + ); + ( + ::arrow2::datatypes::Field::new("keypoint_ids", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = ::try_to_arrow( - self.instance_keys.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.InstanceKey".into(), - Box::new(array.data_type().clone()), - Some("rerun.instance_key".into()), - ); - ( - ::arrow2::datatypes::Field::new("instance_keys", datatype, false), - array, - ) + self.instance_keys + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.InstanceKey".into(), + Box::new(array.data_type().clone()), + Some("rerun.instance_key".into()), + ); + ( + ::arrow2::datatypes::Field::new("instance_keys", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, ] .into_iter() @@ -312,109 +320,102 @@ impl crate::Archetype for Points2D { }) .collect::>>()? }; - let radii = { - let array = arrays_by_name.get("radii").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, + let radii = if let Some(array) = arrays_by_name.get("radii") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; - let colors = { - let array = arrays_by_name.get("colors").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, + let colors = if let Some(array) = arrays_by_name.get("colors") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; - let labels = { - let array = arrays_by_name.get("labels").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, + let labels = if let Some(array) = arrays_by_name.get("labels") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; - let draw_order = { - let array = arrays_by_name.get("draw_order").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let class_ids = { - let array = arrays_by_name.get("class_ids").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { + let draw_order = if let Some(array) = arrays_by_name.get("draw_order") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let class_ids = if let Some(array) = arrays_by_name.get("class_ids") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; - let keypoint_ids = { - let array = arrays_by_name.get("keypoint_ids").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, + let keypoint_ids = if let Some(array) = arrays_by_name.get("keypoint_ids") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; - let instance_keys = { - let array = arrays_by_name.get("instance_keys").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, + let instance_keys = if let Some(array) = arrays_by_name.get("instance_keys") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; Ok(Self { points, @@ -430,25 +431,69 @@ impl crate::Archetype for Points2D { } impl Points2D { - pub fn new( - points: impl IntoIterator>, + pub fn new(points: impl IntoIterator>) -> Self { + Self { + points: points.into_iter().map(Into::into).collect(), + radii: None, + colors: None, + labels: None, + draw_order: None, + class_ids: None, + keypoint_ids: None, + instance_keys: None, + } + } + + pub fn with_radii( + mut self, radii: impl IntoIterator>, + ) -> Self { + self.radii = Some(radii.into_iter().map(Into::into).collect()); + self + } + + pub fn with_colors( + mut self, colors: impl IntoIterator>, + ) -> Self { + self.colors = Some(colors.into_iter().map(Into::into).collect()); + self + } + + pub fn with_labels( + mut self, labels: impl IntoIterator>, - draw_order: impl Into, + ) -> Self { + self.labels = Some(labels.into_iter().map(Into::into).collect()); + self + } + + pub fn with_draw_order(mut self, draw_order: impl Into) -> Self { + self.draw_order = Some(draw_order.into()); + self + } + + pub fn with_class_ids( + mut self, class_ids: impl IntoIterator>, + ) -> Self { + self.class_ids = Some(class_ids.into_iter().map(Into::into).collect()); + self + } + + pub fn with_keypoint_ids( + mut self, keypoint_ids: impl IntoIterator>, + ) -> Self { + self.keypoint_ids = Some(keypoint_ids.into_iter().map(Into::into).collect()); + self + } + + pub fn with_instance_keys( + mut self, instance_keys: impl IntoIterator>, ) -> Self { - Self { - points: points.into_iter().map(Into::into).collect(), - radii: radii.into_iter().map(Into::into).collect(), - colors: colors.into_iter().map(Into::into).collect(), - labels: labels.into_iter().map(Into::into).collect(), - draw_order: draw_order.into(), - class_ids: class_ids.into_iter().map(Into::into).collect(), - keypoint_ids: keypoint_ids.into_iter().map(Into::into).collect(), - instance_keys: instance_keys.into_iter().map(Into::into).collect(), - } + self.instance_keys = Some(instance_keys.into_iter().map(Into::into).collect()); + self } } diff --git a/crates/re_types/src/components/fuzzy.rs b/crates/re_types/src/components/fuzzy.rs index d76a24f8436ed..d5e9d32ac390b 100644 --- a/crates/re_types/src/components/fuzzy.rs +++ b/crates/re_types/src/components/fuzzy.rs @@ -42,7 +42,7 @@ impl crate::Component for AffixFuzzer1 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -54,7 +54,7 @@ impl crate::Component for AffixFuzzer1 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -62,10 +62,10 @@ impl crate::Component for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -84,10 +84,10 @@ impl crate::Component for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, ]) @@ -182,7 +182,7 @@ impl crate::Component for AffixFuzzer2 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -194,7 +194,7 @@ impl crate::Component for AffixFuzzer2 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -202,10 +202,10 @@ impl crate::Component for AffixFuzzer2 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -224,10 +224,10 @@ impl crate::Component for AffixFuzzer2 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, ]) @@ -324,7 +324,7 @@ impl crate::Component for AffixFuzzer3 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -336,7 +336,7 @@ impl crate::Component for AffixFuzzer3 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -344,10 +344,10 @@ impl crate::Component for AffixFuzzer3 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -366,10 +366,10 @@ impl crate::Component for AffixFuzzer3 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, ]) @@ -435,7 +435,7 @@ impl crate::Component for AffixFuzzer3 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer4 { - pub single_optional: crate::datatypes::AffixFuzzer1, + pub single_optional: Option, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer4> { @@ -466,7 +466,7 @@ impl crate::Component for AffixFuzzer4 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -478,7 +478,7 @@ impl crate::Component for AffixFuzzer4 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -486,10 +486,10 @@ impl crate::Component for AffixFuzzer4 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -508,10 +508,10 @@ impl crate::Component for AffixFuzzer4 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, ]) @@ -532,10 +532,12 @@ impl crate::Component for AffixFuzzer4 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { single_optional } = datum.into_owned(); - single_optional - }); + let datum = datum + .map(|datum| { + let Self { single_optional } = datum.into_owned(); + single_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -565,18 +567,14 @@ impl crate::Component for AffixFuzzer4 { use ::arrow2::{array::*, datatypes::*}; Ok(crate::datatypes::AffixFuzzer1::try_from_arrow_opt(data)? .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| res.map(|single_optional| Some(Self { single_optional }))) .collect::>>>()?) } } #[derive(Debug, Clone, PartialEq)] -pub struct AffixFuzzer5(pub crate::datatypes::AffixFuzzer1); +pub struct AffixFuzzer5(pub Option); impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer5> { #[inline] @@ -606,7 +604,7 @@ impl crate::Component for AffixFuzzer5 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -618,7 +616,7 @@ impl crate::Component for AffixFuzzer5 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -626,10 +624,10 @@ impl crate::Component for AffixFuzzer5 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -648,10 +646,10 @@ impl crate::Component for AffixFuzzer5 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, ]) @@ -672,10 +670,12 @@ impl crate::Component for AffixFuzzer5 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self(data0) = datum.into_owned(); - data0 - }); + let datum = datum + .map(|datum| { + let Self(data0) = datum.into_owned(); + data0 + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -705,11 +705,7 @@ impl crate::Component for AffixFuzzer5 { use ::arrow2::{array::*, datatypes::*}; Ok(crate::datatypes::AffixFuzzer1::try_from_arrow_opt(data)? .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>()?) } @@ -717,7 +713,7 @@ impl crate::Component for AffixFuzzer5 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer6 { - pub single_optional: crate::datatypes::AffixFuzzer1, + pub single_optional: Option, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer6> { @@ -748,7 +744,7 @@ impl crate::Component for AffixFuzzer6 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -760,7 +756,7 @@ impl crate::Component for AffixFuzzer6 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -768,10 +764,10 @@ impl crate::Component for AffixFuzzer6 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -790,10 +786,10 @@ impl crate::Component for AffixFuzzer6 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, ]) @@ -814,10 +810,12 @@ impl crate::Component for AffixFuzzer6 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { single_optional } = datum.into_owned(); - single_optional - }); + let datum = datum + .map(|datum| { + let Self { single_optional } = datum.into_owned(); + single_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -847,11 +845,7 @@ impl crate::Component for AffixFuzzer6 { use ::arrow2::{array::*, datatypes::*}; Ok(crate::datatypes::AffixFuzzer1::try_from_arrow_opt(data)? .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| res.map(|single_optional| Some(Self { single_optional }))) .collect::>>>()?) } @@ -859,7 +853,7 @@ impl crate::Component for AffixFuzzer6 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer7 { - pub many_optional: Vec, + pub many_optional: Option>, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer7> { @@ -892,7 +886,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -904,7 +898,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -912,10 +906,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -934,14 +928,14 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, ]), - is_nullable: false, + is_nullable: true, metadata: [].into(), })) } @@ -961,10 +955,12 @@ impl crate::Component for AffixFuzzer7 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { many_optional } = datum.into_owned(); - many_optional - }); + let datum = datum + .map(|datum| { + let Self { many_optional } = datum.into_owned(); + many_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -1008,7 +1004,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1020,7 +1016,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1028,10 +1024,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1050,14 +1046,14 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, ]), - is_nullable: false, + is_nullable: true, metadata: [].into(), }))), None, @@ -1110,7 +1106,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1122,7 +1118,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1130,10 +1126,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1152,10 +1148,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, ]), @@ -1183,11 +1179,7 @@ impl crate::Component for AffixFuzzer7 { .collect::>>>()? .into_iter() } - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| res.map(|many_optional| Some(Self { many_optional }))) .collect::>>>()?) } @@ -1195,7 +1187,7 @@ impl crate::Component for AffixFuzzer7 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer8 { - pub single_float_optional: f32, + pub single_float_optional: Option, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer8> { @@ -1240,12 +1232,14 @@ impl crate::Component for AffixFuzzer8 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { - single_float_optional, - } = datum.into_owned(); - single_float_optional - }); + let datum = datum + .map(|datum| { + let Self { + single_float_optional, + } = datum.into_owned(); + single_float_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -1289,11 +1283,7 @@ impl crate::Component for AffixFuzzer8 { .unwrap() .into_iter() .map(|v| v.copied()) - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| { res.map(|single_float_optional| { Some(Self { @@ -1434,7 +1424,7 @@ impl crate::Component for AffixFuzzer9 { #[derive(Debug, Clone, PartialEq, Eq)] pub struct AffixFuzzer10 { - pub single_string_optional: String, + pub single_string_optional: Option, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer10> { @@ -1479,12 +1469,14 @@ impl crate::Component for AffixFuzzer10 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { - single_string_optional, - } = datum.into_owned(); - single_string_optional - }); + let datum = datum + .map(|datum| { + let Self { + single_string_optional, + } = datum.into_owned(); + single_string_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -1543,11 +1535,7 @@ impl crate::Component for AffixFuzzer10 { .unwrap() .into_iter() .map(|v| v.map(ToOwned::to_owned)) - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| { res.map(|single_string_optional| { Some(Self { @@ -1561,7 +1549,7 @@ impl crate::Component for AffixFuzzer10 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer11 { - pub many_floats_optional: Vec, + pub many_floats_optional: Option>, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer11> { @@ -1591,7 +1579,7 @@ impl crate::Component for AffixFuzzer11 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })) } @@ -1611,12 +1599,14 @@ impl crate::Component for AffixFuzzer11 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { - many_floats_optional, - } = datum.into_owned(); - many_floats_optional - }); + let datum = datum + .map(|datum| { + let Self { + many_floats_optional, + } = datum.into_owned(); + many_floats_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -1657,7 +1647,7 @@ impl crate::Component for AffixFuzzer11 { Box::new(DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }))), None, @@ -1745,11 +1735,7 @@ impl crate::Component for AffixFuzzer11 { .collect::>>>()? .into_iter() } - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| { res.map(|many_floats_optional| { Some(Self { @@ -1981,7 +1967,7 @@ impl crate::Component for AffixFuzzer12 { #[derive(Debug, Clone, PartialEq, Eq)] pub struct AffixFuzzer13 { - pub many_strings_optional: Vec, + pub many_strings_optional: Option>, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer13> { @@ -2011,7 +1997,7 @@ impl crate::Component for AffixFuzzer13 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })) } @@ -2031,12 +2017,14 @@ impl crate::Component for AffixFuzzer13 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { - many_strings_optional, - } = datum.into_owned(); - many_strings_optional - }); + let datum = datum + .map(|datum| { + let Self { + many_strings_optional, + } = datum.into_owned(); + many_strings_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -2077,7 +2065,7 @@ impl crate::Component for AffixFuzzer13 { Box::new(DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }))), None, @@ -2181,11 +2169,7 @@ impl crate::Component for AffixFuzzer13 { .collect::>>>()? .into_iter() } - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| { res.map(|many_strings_optional| { Some(Self { diff --git a/crates/re_types/src/datatypes/fuzzy.rs b/crates/re_types/src/datatypes/fuzzy.rs index e2dabf0133994..1bcced7de8791 100644 --- a/crates/re_types/src/datatypes/fuzzy.rs +++ b/crates/re_types/src/datatypes/fuzzy.rs @@ -11,12 +11,12 @@ #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer1 { - pub single_float_optional: f32, + pub single_float_optional: Option, pub single_string_required: String, - pub single_string_optional: String, - pub many_floats_optional: Vec, + pub single_string_optional: Option, + pub many_floats_optional: Option>, pub many_strings_required: Vec, - pub many_strings_optional: Vec, + pub many_strings_optional: Option>, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer1> { @@ -47,7 +47,7 @@ impl crate::Datatype for AffixFuzzer1 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -59,7 +59,7 @@ impl crate::Datatype for AffixFuzzer1 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -67,10 +67,10 @@ impl crate::Datatype for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -89,10 +89,10 @@ impl crate::Datatype for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, ]) @@ -137,13 +137,16 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, single_float_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum.as_ref().map(|datum| { - let Self { - single_float_optional, - .. - } = &**datum; - single_float_optional.clone() - }); + let datum = datum + .as_ref() + .map(|datum| { + let Self { + single_float_optional, + .. + } = &**datum; + single_float_optional.clone() + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -214,13 +217,16 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, single_string_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum.as_ref().map(|datum| { - let Self { - single_string_optional, - .. - } = &**datum; - single_string_optional.clone() - }); + let datum = datum + .as_ref() + .map(|datum| { + let Self { + single_string_optional, + .. + } = &**datum; + single_string_optional.clone() + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -260,13 +266,16 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, many_floats_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum.as_ref().map(|datum| { - let Self { - many_floats_optional, - .. - } = &**datum; - many_floats_optional.clone() - }); + let datum = datum + .as_ref() + .map(|datum| { + let Self { + many_floats_optional, + .. + } = &**datum; + many_floats_optional.clone() + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -308,7 +317,7 @@ impl crate::Datatype for AffixFuzzer1 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })) .to_logical_type() @@ -431,13 +440,16 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, many_strings_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum.as_ref().map(|datum| { - let Self { - many_strings_optional, - .. - } = &**datum; - many_strings_optional.clone() - }); + let datum = datum + .as_ref() + .map(|datum| { + let Self { + many_strings_optional, + .. + } = &**datum; + many_strings_optional.clone() + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -479,7 +491,7 @@ impl crate::Datatype for AffixFuzzer1 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })) .to_logical_type() @@ -758,36 +770,20 @@ impl crate::Datatype for AffixFuzzer1 { is_valid(i) .then(|| { Ok(Self { - single_float_optional: single_float_optional.ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - } - })?, + single_float_optional, single_string_required: single_string_required.ok_or_else( || crate::DeserializationError::MissingData { datatype: data.data_type().clone(), }, )?, - single_string_optional: single_string_optional.ok_or_else( - || crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }, - )?, - many_floats_optional: many_floats_optional.ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - } - })?, + single_string_optional, + many_floats_optional, many_strings_required: many_strings_required.ok_or_else(|| { crate::DeserializationError::MissingData { datatype: data.data_type().clone(), } })?, - many_strings_optional: many_strings_optional.ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - } - })?, + many_strings_optional, }) }) .transpose() @@ -799,7 +795,7 @@ impl crate::Datatype for AffixFuzzer1 { } #[derive(Debug, Clone, PartialEq)] -pub struct AffixFuzzer2(pub f32); +pub struct AffixFuzzer2(pub Option); impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer2> { #[inline] @@ -843,10 +839,12 @@ impl crate::Datatype for AffixFuzzer2 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self(data0) = datum.into_owned(); - data0 - }); + let datum = datum + .map(|datum| { + let Self(data0) = datum.into_owned(); + data0 + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -887,11 +885,7 @@ impl crate::Datatype for AffixFuzzer2 { .unwrap() .into_iter() .map(|v| v.copied()) - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>()?) } diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py index 36ed3b9895cb4..ce6276757eaa4 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py @@ -118,108 +118,134 @@ class AffixFuzzer1(Archetype): metadata={"component": "primary"}, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) - fuzz2001: components.AffixFuzzer1Array = field( - metadata={"component": "primary"}, + fuzz2001: components.AffixFuzzer1Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer1Array.from_similar, # type: ignore[misc] ) - fuzz2002: components.AffixFuzzer2Array = field( - metadata={"component": "primary"}, + fuzz2002: components.AffixFuzzer2Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer2Array.from_similar, # type: ignore[misc] ) - fuzz2003: components.AffixFuzzer3Array = field( - metadata={"component": "primary"}, + fuzz2003: components.AffixFuzzer3Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer3Array.from_similar, # type: ignore[misc] ) - fuzz2004: components.AffixFuzzer4Array = field( - metadata={"component": "primary"}, + fuzz2004: components.AffixFuzzer4Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer4Array.from_similar, # type: ignore[misc] ) - fuzz2005: components.AffixFuzzer5Array = field( - metadata={"component": "primary"}, + fuzz2005: components.AffixFuzzer5Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer5Array.from_similar, # type: ignore[misc] ) - fuzz2006: components.AffixFuzzer6Array = field( - metadata={"component": "primary"}, + fuzz2006: components.AffixFuzzer6Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer6Array.from_similar, # type: ignore[misc] ) - fuzz2007: components.AffixFuzzer7Array = field( - metadata={"component": "primary"}, + fuzz2007: components.AffixFuzzer7Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer7Array.from_similar, # type: ignore[misc] ) - fuzz2008: components.AffixFuzzer8Array = field( - metadata={"component": "primary"}, + fuzz2008: components.AffixFuzzer8Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer8Array.from_similar, # type: ignore[misc] ) - fuzz2009: components.AffixFuzzer9Array = field( - metadata={"component": "primary"}, + fuzz2009: components.AffixFuzzer9Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer9Array.from_similar, # type: ignore[misc] ) - fuzz2010: components.AffixFuzzer10Array = field( - metadata={"component": "primary"}, + fuzz2010: components.AffixFuzzer10Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer10Array.from_similar, # type: ignore[misc] ) - fuzz2011: components.AffixFuzzer11Array = field( - metadata={"component": "primary"}, + fuzz2011: components.AffixFuzzer11Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer11Array.from_similar, # type: ignore[misc] ) - fuzz2012: components.AffixFuzzer12Array = field( - metadata={"component": "primary"}, + fuzz2012: components.AffixFuzzer12Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer12Array.from_similar, # type: ignore[misc] ) - fuzz2013: components.AffixFuzzer13Array = field( - metadata={"component": "primary"}, + fuzz2013: components.AffixFuzzer13Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) - fuzz2101: components.AffixFuzzer1Array = field( - metadata={"component": "primary"}, + fuzz2101: components.AffixFuzzer1Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer1Array.from_similar, # type: ignore[misc] ) - fuzz2102: components.AffixFuzzer2Array = field( - metadata={"component": "primary"}, + fuzz2102: components.AffixFuzzer2Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer2Array.from_similar, # type: ignore[misc] ) - fuzz2103: components.AffixFuzzer3Array = field( - metadata={"component": "primary"}, + fuzz2103: components.AffixFuzzer3Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer3Array.from_similar, # type: ignore[misc] ) - fuzz2104: components.AffixFuzzer4Array = field( - metadata={"component": "primary"}, + fuzz2104: components.AffixFuzzer4Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer4Array.from_similar, # type: ignore[misc] ) - fuzz2105: components.AffixFuzzer5Array = field( - metadata={"component": "primary"}, + fuzz2105: components.AffixFuzzer5Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer5Array.from_similar, # type: ignore[misc] ) - fuzz2106: components.AffixFuzzer6Array = field( - metadata={"component": "primary"}, + fuzz2106: components.AffixFuzzer6Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer6Array.from_similar, # type: ignore[misc] ) - fuzz2107: components.AffixFuzzer7Array = field( - metadata={"component": "primary"}, + fuzz2107: components.AffixFuzzer7Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer7Array.from_similar, # type: ignore[misc] ) - fuzz2108: components.AffixFuzzer8Array = field( - metadata={"component": "primary"}, + fuzz2108: components.AffixFuzzer8Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer8Array.from_similar, # type: ignore[misc] ) - fuzz2109: components.AffixFuzzer9Array = field( - metadata={"component": "primary"}, + fuzz2109: components.AffixFuzzer9Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer9Array.from_similar, # type: ignore[misc] ) - fuzz2110: components.AffixFuzzer10Array = field( - metadata={"component": "primary"}, + fuzz2110: components.AffixFuzzer10Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer10Array.from_similar, # type: ignore[misc] ) - fuzz2111: components.AffixFuzzer11Array = field( - metadata={"component": "primary"}, + fuzz2111: components.AffixFuzzer11Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer11Array.from_similar, # type: ignore[misc] ) - fuzz2112: components.AffixFuzzer12Array = field( - metadata={"component": "primary"}, + fuzz2112: components.AffixFuzzer12Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer12Array.from_similar, # type: ignore[misc] ) - fuzz2113: components.AffixFuzzer13Array = field( - metadata={"component": "primary"}, + fuzz2113: components.AffixFuzzer13Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) __str__ = Archetype.__str__ diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py index 30a6ba3c85376..958554bfe0625 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py @@ -39,16 +39,18 @@ class Points2D(Archetype): All the actual 2D points that make up the point cloud. """ - radii: components.RadiusArray = field( - metadata={"component": "primary"}, + radii: components.RadiusArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.RadiusArray.from_similar, # type: ignore[misc] ) """ Optional radii for the points, effectively turning them into circles. """ - colors: components.ColorArray = field( - metadata={"component": "primary"}, + colors: components.ColorArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.ColorArray.from_similar, # type: ignore[misc] ) """ @@ -58,16 +60,18 @@ class Points2D(Archetype): As either 0-1 floats or 0-255 integers, with separate alpha. """ - labels: components.LabelArray = field( - metadata={"component": "primary"}, + labels: components.LabelArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.LabelArray.from_similar, # type: ignore[misc] ) """ Optional text labels for the points. """ - draw_order: components.DrawOrderArray = field( - metadata={"component": "primary"}, + draw_order: components.DrawOrderArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.DrawOrderArray.from_similar, # type: ignore[misc] ) """ @@ -77,8 +81,9 @@ class Points2D(Archetype): The default for 2D points is 30.0. """ - class_ids: components.ClassIdArray = field( - metadata={"component": "primary"}, + class_ids: components.ClassIdArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.ClassIdArray.from_similar, # type: ignore[misc] ) """ @@ -87,8 +92,9 @@ class Points2D(Archetype): The class ID provides colors and labels if not specified explicitly. """ - keypoint_ids: components.KeypointIdArray = field( - metadata={"component": "primary"}, + keypoint_ids: components.KeypointIdArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.KeypointIdArray.from_similar, # type: ignore[misc] ) """ @@ -102,8 +108,9 @@ class Points2D(Archetype): detected skeleton. """ - instance_keys: components.InstanceKeyArray = field( - metadata={"component": "primary"}, + instance_keys: components.InstanceKeyArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.InstanceKeyArray.from_similar, # type: ignore[misc] ) """ diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py index 45530216d6e3b..3b49fdbb2505a 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py @@ -175,7 +175,7 @@ class AffixFuzzer6Array(BaseDelegatingExtensionArray[datatypes.AffixFuzzer1Array @define class AffixFuzzer7: - many_optional: list[datatypes.AffixFuzzer1] = field() + many_optional: list[datatypes.AffixFuzzer1] | None = field(default=None) AffixFuzzer7Like = AffixFuzzer7 @@ -197,21 +197,21 @@ def __init__(self) -> None: "item", pa.struct( [ - pa.field("single_float_optional", pa.float32(), False, {}), + pa.field("single_float_optional", pa.float32(), True, {}), pa.field("single_string_required", pa.utf8(), False, {}), - pa.field("single_string_optional", pa.utf8(), False, {}), + pa.field("single_string_optional", pa.utf8(), True, {}), pa.field( - "many_floats_optional", pa.list_(pa.field("item", pa.float32(), False, {})), False, {} + "many_floats_optional", pa.list_(pa.field("item", pa.float32(), True, {})), True, {} ), pa.field( "many_strings_required", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {} ), pa.field( - "many_strings_optional", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {} + "many_strings_optional", pa.list_(pa.field("item", pa.utf8(), True, {})), True, {} ), ] ), - False, + True, {}, ) ), @@ -236,14 +236,11 @@ def _native_to_pa_array(data: AffixFuzzer7ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer8: - single_float_optional: float = field() + single_float_optional: float | None = field(default=None) def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: return np.asarray(self.single_float_optional, dtype=dtype) - def __float__(self) -> float: - return float(self.single_float_optional) - AffixFuzzer8Like = AffixFuzzer8 AffixFuzzer8ArrayLike = Union[ @@ -315,10 +312,7 @@ def _native_to_pa_array(data: AffixFuzzer9ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer10: - single_string_optional: str = field() - - def __str__(self) -> str: - return str(self.single_string_optional) + single_string_optional: str | None = field(default=None) AffixFuzzer10Like = AffixFuzzer10 @@ -353,7 +347,7 @@ def _native_to_pa_array(data: AffixFuzzer10ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer11: - many_floats_optional: npt.NDArray[np.float32] = field(converter=to_np_float32) + many_floats_optional: npt.NDArray[np.float32] | None = field(default=None, converter=to_np_float32) def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: return np.asarray(self.many_floats_optional, dtype=dtype) @@ -372,7 +366,7 @@ def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: class AffixFuzzer11Type(BaseExtensionType): def __init__(self) -> None: pa.ExtensionType.__init__( - self, pa.list_(pa.field("item", pa.float32(), False, {})), "rerun.testing.components.AffixFuzzer11" + self, pa.list_(pa.field("item", pa.float32(), True, {})), "rerun.testing.components.AffixFuzzer11" ) @@ -430,7 +424,7 @@ def _native_to_pa_array(data: AffixFuzzer12ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer13: - many_strings_optional: list[str] = field() + many_strings_optional: list[str] | None = field(default=None) AffixFuzzer13Like = AffixFuzzer13 @@ -446,7 +440,7 @@ class AffixFuzzer13: class AffixFuzzer13Type(BaseExtensionType): def __init__(self) -> None: pa.ExtensionType.__init__( - self, pa.list_(pa.field("item", pa.utf8(), False, {})), "rerun.testing.components.AffixFuzzer13" + self, pa.list_(pa.field("item", pa.utf8(), True, {})), "rerun.testing.components.AffixFuzzer13" ) diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py index 1c24fa289e816..c73509a3dcdfd 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py @@ -33,12 +33,12 @@ @define class AffixFuzzer1: - single_float_optional: float = field() single_string_required: str = field() - single_string_optional: str = field() - many_floats_optional: npt.NDArray[np.float32] = field(converter=to_np_float32) many_strings_required: list[str] = field() - many_strings_optional: list[str] = field() + single_float_optional: float | None = field(default=None) + single_string_optional: str | None = field(default=None) + many_floats_optional: npt.NDArray[np.float32] | None = field(default=None, converter=to_np_float32) + many_strings_optional: list[str] | None = field(default=None) AffixFuzzer1Like = AffixFuzzer1 @@ -57,12 +57,12 @@ def __init__(self) -> None: self, pa.struct( [ - pa.field("single_float_optional", pa.float32(), False, {}), + pa.field("single_float_optional", pa.float32(), True, {}), pa.field("single_string_required", pa.utf8(), False, {}), - pa.field("single_string_optional", pa.utf8(), False, {}), - pa.field("many_floats_optional", pa.list_(pa.field("item", pa.float32(), False, {})), False, {}), + pa.field("single_string_optional", pa.utf8(), True, {}), + pa.field("many_floats_optional", pa.list_(pa.field("item", pa.float32(), True, {})), True, {}), pa.field("many_strings_required", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {}), - pa.field("many_strings_optional", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {}), + pa.field("many_strings_optional", pa.list_(pa.field("item", pa.utf8(), True, {})), True, {}), ] ), "rerun.testing.datatypes.AffixFuzzer1", @@ -86,14 +86,11 @@ def _native_to_pa_array(data: AffixFuzzer1ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer2: - single_float_optional: float = field() + single_float_optional: float | None = field(default=None) def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: return np.asarray(self.single_float_optional, dtype=dtype) - def __float__(self) -> float: - return float(self.single_float_optional) - AffixFuzzer2Like = AffixFuzzer2 AffixFuzzer2ArrayLike = Union[