From f5b9c3f6837cbeabb046eb6b6c82ece4fc7ec808 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 3 Mar 2023 10:09:22 +0100 Subject: [PATCH 1/5] Add spell checking to CI --- .github/workflows/typos.yml | 16 ++++++++++++++++ _typos.toml | 1 + 2 files changed, 17 insertions(+) create mode 100644 .github/workflows/typos.yml create mode 100644 _typos.toml diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 000000000000..67f8c3cec35b --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,16 @@ +# https://github.com/crate-ci/typos +# Add exceptions to _typos.toml + +name: Spell Check +on: [pull_request] + +jobs: + run: + name: Spell Check + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v2 + + - name: Check spelling of entire workspace + uses: crate-ci/typos@master diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 000000000000..bee28f18e387 --- /dev/null +++ b/_typos.toml @@ -0,0 +1 @@ +# https://github.com/crate-ci/typos From 0698d1a211d9a18942cfc63bd307b7730dbac433 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 3 Mar 2023 10:17:59 +0100 Subject: [PATCH 2/5] Fix a bunch of typos with `typos -w` --- _typos.toml | 3 +++ ci_docker/publish.sh | 2 +- clippy.toml | 6 +++--- crates/re_analytics/Cargo.toml | 2 +- crates/re_analytics/src/pipeline_native.rs | 2 +- crates/re_arrow_store/src/store_write.rs | 2 +- crates/re_arrow_store/tests/data_store.rs | 2 +- crates/re_build_info/src/{buid_info.rs => build_info.rs} | 0 crates/re_build_info/src/lib.rs | 4 ++-- crates/re_log_types/src/path/mod.rs | 2 +- crates/re_log_types/src/time.rs | 4 ++-- crates/re_log_types/src/time_range.rs | 2 +- crates/re_renderer/shader/generic_skybox.wgsl | 4 ++-- crates/re_renderer/shader/lines.wgsl | 2 +- crates/re_renderer/shader/utils/camera.wgsl | 2 +- crates/re_renderer/src/mesh.rs | 2 +- crates/re_renderer/src/point_cloud_builder.rs | 4 ++-- crates/re_renderer/src/renderer/lines.rs | 2 +- crates/re_renderer/src/resource_managers/texture_manager.rs | 2 +- crates/re_sdk/src/msg_sender.rs | 2 +- crates/re_ui/data/design_tokens.json | 2 +- crates/re_ui/src/design_tokens.rs | 2 +- crates/re_viewer/src/ui/editable_auto_value.rs | 2 +- crates/re_viewer/src/ui/time_panel/time_ranges_ui.rs | 4 ++-- crates/re_viewer/src/ui/view_spatial/eye.rs | 2 +- crates/re_viewer/src/ui/view_spatial/ui.rs | 6 +++--- crates/re_viewer/src/ui/view_time_series/scene.rs | 2 +- crates/rerun/src/run.rs | 2 +- examples/python/colmap/main.py | 2 +- examples/python/objectron/proto/a_r_capture_metadata.proto | 2 +- examples/python/objectron/proto/object.proto | 4 ++-- examples/python/objectron/proto/objectron/proto.py | 6 +++--- examples/python/tracking_hf_opencv/main.py | 4 ++-- examples/rust/objectron/src/main.rs | 4 ++-- examples/rust/objectron/src/objectron.rs | 6 +++--- rerun_py/rerun_sdk/rerun/__init__.py | 2 +- rerun_py/rerun_sdk/rerun/log/__init__.py | 2 +- rerun_py/rerun_sdk/rerun/script_helpers.py | 2 +- 38 files changed, 55 insertions(+), 52 deletions(-) rename crates/re_build_info/src/{buid_info.rs => build_info.rs} (100%) diff --git a/_typos.toml b/_typos.toml index bee28f18e387..c58655ae4c05 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1 +1,4 @@ # https://github.com/crate-ci/typos + +[default.extend-words] +lod = "lod" # level-of-detail diff --git a/ci_docker/publish.sh b/ci_docker/publish.sh index 4b4b8f40b578..cb1fb4d8ec5f 100755 --- a/ci_docker/publish.sh +++ b/ci_docker/publish.sh @@ -1,6 +1,6 @@ VERSION=0.5 # Bump on each new version. Remember to update the version in the Dockerfile too. -# The build needs to run from top of repo to access the requirments.txt +# The build needs to run from top of repo to access the requirements.txt cd `git rev-parse --show-toplevel` # Pull :latest so we have the correct cache diff --git a/clippy.toml b/clippy.toml index 2dca104c140c..29a55c49503e 100644 --- a/clippy.toml +++ b/clippy.toml @@ -19,9 +19,9 @@ disallowed-methods = [ "std::env::temp_dir", # Use the tempdir crate instead # Disabled because of https://github.com/rust-lang/rust-clippy/issues/10406 - # "std::time::Instant::now", # use `instant` crate instead for wasm/web compatability - "std::time::Duration::elapsed", # use `instant` crate instead for wasm/web compatability - "std::time::SystemTime::now", # use `instant` or `time` crates instead for wasm/web compatability + # "std::time::Instant::now", # use `instant` crate instead for wasm/web compatibility + "std::time::Duration::elapsed", # use `instant` crate instead for wasm/web compatibility + "std::time::SystemTime::now", # use `instant` or `time` crates instead for wasm/web compatibility "std::thread::spawn", # Use `std::thread::Builder` and name the thread diff --git a/crates/re_analytics/Cargo.toml b/crates/re_analytics/Cargo.toml index 2f2c776f2a94..2dd30b3fb583 100644 --- a/crates/re_analytics/Cargo.toml +++ b/crates/re_analytics/Cargo.toml @@ -36,7 +36,7 @@ uuid = { version = "1.1", features = ["serde", "v4", "js"] } directories-next = "2" ureq = { version = "2.6", features = [ "json", -] } # TODO(emilk): use ehttp for web supprt +] } # TODO(emilk): use ehttp for web support [target.'cfg(target_arch = "wasm32")'.dependencies] web-sys = { version = "0.3.58", features = ["Storage"] } diff --git a/crates/re_analytics/src/pipeline_native.rs b/crates/re_analytics/src/pipeline_native.rs index c578ec909ba1..12a25155fc9a 100644 --- a/crates/re_analytics/src/pipeline_native.rs +++ b/crates/re_analytics/src/pipeline_native.rs @@ -298,7 +298,7 @@ fn flush_events( match serde_json::from_str::(&event_str) { Ok(event) => Some(event), Err(err) => { - // NOTE: This is effectively where we detect posssible half-writes. + // NOTE: This is effectively where we detect possible half-writes. error!(%err, %analytics_id, %session_id, "couldn't deserialize event from analytics data file: dropping it"); None diff --git a/crates/re_arrow_store/src/store_write.rs b/crates/re_arrow_store/src/store_write.rs index eeb8f0d9c2b1..bd73eaad06a0 100644 --- a/crates/re_arrow_store/src/store_write.rs +++ b/crates/re_arrow_store/src/store_write.rs @@ -656,7 +656,7 @@ impl IndexBucket { indices, } = &mut *guard; - // append time to primary index and update time range approriately + // append time to primary index and update time range appropriately times.push(time.as_i64()); *time_range = TimeRange::new(time_range.min.min(time), time_range.max.max(time)); diff --git a/crates/re_arrow_store/tests/data_store.rs b/crates/re_arrow_store/tests/data_store.rs index c654d2f0137a..1f5917b92249 100644 --- a/crates/re_arrow_store/tests/data_store.rs +++ b/crates/re_arrow_store/tests/data_store.rs @@ -153,7 +153,7 @@ fn all_components() { let components_b = &[ ColorRGBA::name(), // added by us, timeless - Rect2D::name(), // ⚠ inherited before the buckets got splitted apart! + Rect2D::name(), // ⚠ inherited before the buckets got split apart! Point2D::name(), // added by us cluster_key, // always here MsgId::name(), // automatically appended by MsgBundle diff --git a/crates/re_build_info/src/buid_info.rs b/crates/re_build_info/src/build_info.rs similarity index 100% rename from crates/re_build_info/src/buid_info.rs rename to crates/re_build_info/src/build_info.rs diff --git a/crates/re_build_info/src/lib.rs b/crates/re_build_info/src/lib.rs index 0903127e14d8..f15fa5af5b07 100644 --- a/crates/re_build_info/src/lib.rs +++ b/crates/re_build_info/src/lib.rs @@ -2,10 +2,10 @@ //! //! To use this you also need to call `re_build_build_info::export_env_vars()` from your build.rs. -mod buid_info; +mod build_info; mod crate_version; -pub use buid_info::BuildInfo; +pub use build_info::BuildInfo; pub use crate_version::CrateVersion; /// Create a [`BuildInfo`] at compile-time using environment variables exported by diff --git a/crates/re_log_types/src/path/mod.rs b/crates/re_log_types/src/path/mod.rs index fe7a9b357849..010a3b5bff60 100644 --- a/crates/re_log_types/src/path/mod.rs +++ b/crates/re_log_types/src/path/mod.rs @@ -31,7 +31,7 @@ pub enum EntityPathPart { /// Struct member. Each member can have a different type. Name(InternedString), - /// Array/table/map member. Each member must be of the same type (homogenous). + /// Array/table/map member. Each member must be of the same type (homogeneous). Index(Index), } diff --git a/crates/re_log_types/src/time.rs b/crates/re_log_types/src/time.rs index f9dbb8b33568..7eca85f9cf3f 100644 --- a/crates/re_log_types/src/time.rs +++ b/crates/re_log_types/src/time.rs @@ -38,7 +38,7 @@ impl Time { } /// If true, this time is likely relative to unix epoch. - pub fn is_abolute_date(&self) -> bool { + pub fn is_absolute_date(&self) -> bool { let nanos_since_epoch = self.nanos_since_epoch(); let years_since_epoch = nanos_since_epoch / 1_000_000_000 / 60 / 60 / 24 / 365; @@ -48,7 +48,7 @@ impl Time { /// Returns the absolute datetime if applicable. pub fn to_datetime(&self) -> Option { let ns_since_epoch = self.nanos_since_epoch(); - if self.is_abolute_date() { + if self.is_absolute_date() { OffsetDateTime::from_unix_timestamp_nanos(ns_since_epoch as i128).ok() } else { None diff --git a/crates/re_log_types/src/time_range.rs b/crates/re_log_types/src/time_range.rs index 49d3f3833736..09e2ce1193dc 100644 --- a/crates/re_log_types/src/time_range.rs +++ b/crates/re_log_types/src/time_range.rs @@ -52,7 +52,7 @@ impl From<&TimeRange> for RangeInclusive { // ---------------------------------------------------------------------------- -/// Like [`TimeRange`], but using [`TimeReal`] for improved precison. +/// Like [`TimeRange`], but using [`TimeReal`] for improved precision. #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub struct TimeRangeF { diff --git a/crates/re_renderer/shader/generic_skybox.wgsl b/crates/re_renderer/shader/generic_skybox.wgsl index 7978283547b3..a8584abfd19a 100644 --- a/crates/re_renderer/shader/generic_skybox.wgsl +++ b/crates/re_renderer/shader/generic_skybox.wgsl @@ -21,8 +21,8 @@ fn skybox_light_srgb(dir: Vec3) -> Vec3 { @fragment fn main(in: VertexOutput) -> @location(0) Vec4 { let camera_dir = camera_ray_direction_from_screenuv(in.texcoord); - // Messing with direction a bit so it looks like in our old three-d based renderer (for easier comparision) - let rgb = skybox_dark_srgb(camera_dir); // TODO(andreas): Allow switchting to skybox_light + // Messing with direction a bit so it looks like in our old three-d based renderer (for easier comparison) + let rgb = skybox_dark_srgb(camera_dir); // TODO(andreas): Allow switching to skybox_light return Vec4(linear_from_srgb(rgb), 1.0); //return Vec4(camera_dir, 1.0); } diff --git a/crates/re_renderer/shader/lines.wgsl b/crates/re_renderer/shader/lines.wgsl index 189ed8d3ef5d..48a43512c708 100644 --- a/crates/re_renderer/shader/lines.wgsl +++ b/crates/re_renderer/shader/lines.wgsl @@ -31,7 +31,7 @@ const CAP_START_TRIANGLE: u32 = 4u; const CAP_START_ROUND: u32 = 8u; const NO_COLOR_GRADIENT: u32 = 16u; -// A lot of the attributes don't need to be interpolated accross triangles. +// A lot of the attributes don't need to be interpolated across triangles. // To document that and safe some time we mark them up with @interpolate(flat) // (see https://www.w3.org/TR/WGSL/#interpolation) struct VertexOut { diff --git a/crates/re_renderer/shader/utils/camera.wgsl b/crates/re_renderer/shader/utils/camera.wgsl index 5778d9cb891f..4be97aad966b 100644 --- a/crates/re_renderer/shader/utils/camera.wgsl +++ b/crates/re_renderer/shader/utils/camera.wgsl @@ -1,4 +1,4 @@ -// TODO(andreas): global_bindings are imported implicitely +// TODO(andreas): global_bindings are imported implicitly fn inf() -> f32 { return 1.0 / 0.0; diff --git a/crates/re_renderer/src/mesh.rs b/crates/re_renderer/src/mesh.rs index a9c0c88dc28f..52bfd339658b 100644 --- a/crates/re_renderer/src/mesh.rs +++ b/crates/re_renderer/src/mesh.rs @@ -31,7 +31,7 @@ pub mod mesh_vertices { // TODO(andreas): More properties? Different kinds of vertices? } - /// Vertex buffer layouts describing how vertex data should be layed out. + /// Vertex buffer layouts describing how vertex data should be laid out. /// /// Needs to be kept in sync with `mesh_vertex.wgsl`. pub fn vertex_buffer_layouts() -> [VertexBufferLayout; 2] { diff --git a/crates/re_renderer/src/point_cloud_builder.rs b/crates/re_renderer/src/point_cloud_builder.rs index b3c4028194e3..638004a71bac 100644 --- a/crates/re_renderer/src/point_cloud_builder.rs +++ b/crates/re_renderer/src/point_cloud_builder.rs @@ -174,7 +174,7 @@ where /// Returns a `PointBuilder` which can be used to set the colors, radii, and user-data for the points. /// /// Params: - /// - `size_hint`: The `PointBuilder` will pre-allocate buffers to accomodate up to this number of points. + /// - `size_hint`: The `PointBuilder` will pre-allocate buffers to accommodate up to this number of points. /// The resulting point batch, will still be determined by the length of the iterator. /// - `positions`: An iterable of the positions of the collection of points pub fn add_points( @@ -242,7 +242,7 @@ where /// Adds several 2D points. Uses an autogenerated depth value, the same for all points passed. /// /// Params: - /// - `size_hint`: The `PointBuilder` will pre-allocate buffers to accomodate up to this number of points. + /// - `size_hint`: The `PointBuilder` will pre-allocate buffers to accommodate up to this number of points. /// The resulting point batch, will be the size of the length of the `positions` iterator. /// - `positions`: An iterable of the positions of the collection of points #[inline] diff --git a/crates/re_renderer/src/renderer/lines.rs b/crates/re_renderer/src/renderer/lines.rs index 94f7621c5b14..5902f84fc651 100644 --- a/crates/re_renderer/src/renderer/lines.rs +++ b/crates/re_renderer/src/renderer/lines.rs @@ -274,7 +274,7 @@ pub enum LineDrawDataError { // Textures are 2D since 1D textures are very limited in size (8k typically). // Need to keep these values in sync with lines.wgsl! -const POSITION_TEXTURE_SIZE: u32 = 512; // 512 x 512 x vec4 == 4MiB, 262144 PositionDatas +const POSITION_TEXTURE_SIZE: u32 = 512; // 512 x 512 x vec4 == 4MiB, 262144 PositionData const LINE_STRIP_TEXTURE_SIZE: u32 = 256; // 256 x 256 x vec2 == 0.5MiB, 65536 line strips impl LineDrawData { diff --git a/crates/re_renderer/src/resource_managers/texture_manager.rs b/crates/re_renderer/src/resource_managers/texture_manager.rs index 5216363933a8..db2261a9b95d 100644 --- a/crates/re_renderer/src/resource_managers/texture_manager.rs +++ b/crates/re_renderer/src/resource_managers/texture_manager.rs @@ -151,7 +151,7 @@ impl TextureManager2D { let bytes_per_row_unaligned = width_blocks * format_info.block_size as u32; // TODO(andreas): Once we have our own temp buffer for uploading, we can do the padding inplace - // I.e. the only difference will be if we do one memcopy or one memcopy per row, making row padding a nuissance! + // I.e. the only difference will be if we do one memcopy or one memcopy per row, making row padding a nuisance! let data = creation_desc.data; // TODO(andreas): temp allocator for staging data? diff --git a/crates/re_sdk/src/msg_sender.rs b/crates/re_sdk/src/msg_sender.rs index 7872dfcccff4..27b465707a67 100644 --- a/crates/re_sdk/src/msg_sender.rs +++ b/crates/re_sdk/src/msg_sender.rs @@ -251,7 +251,7 @@ impl MsgSender { // --- Send --- - /// Consumes, packs, sanity checkes and finally sends the message to the currently configured + /// Consumes, packs, sanity checks and finally sends the message to the currently configured /// target of the SDK. pub fn send(self, session: &mut Session) -> Result<(), MsgSenderError> { if !session.is_enabled() { diff --git a/crates/re_ui/data/design_tokens.json b/crates/re_ui/data/design_tokens.json index 1414fd920635..9c8974d9a4c5 100644 --- a/crates/re_ui/data/design_tokens.json +++ b/crates/re_ui/data/design_tokens.json @@ -30,7 +30,7 @@ "type": "color" }, "Pressed": { - "description": "Background color for supressed UI elements, like a select that is currently showing a menu", + "description": "Background color for suppressed UI elements, like a select that is currently showing a menu", "value": "{Global.Color.Grey.250}", "type": "color" } diff --git a/crates/re_ui/src/design_tokens.rs b/crates/re_ui/src/design_tokens.rs index 9c35132e8225..4a3642695e87 100644 --- a/crates/re_ui/src/design_tokens.rs +++ b/crates/re_ui/src/design_tokens.rs @@ -154,7 +154,7 @@ fn apply_design_tokens(ctx: &egui::Context) -> DesignTokens { egui_style.debug.show_blocking_widget = false; // turn this on to debug interaction problems - egui_style.spacing.combo_width = 8.0; // minium width of ComboBox - keep them small, with the down-arrow close. + egui_style.spacing.combo_width = 8.0; // minimum width of ComboBox - keep them small, with the down-arrow close. egui_style.spacing.scroll_bar_inner_margin = 2.0; egui_style.spacing.scroll_bar_width = 6.0; diff --git a/crates/re_viewer/src/ui/editable_auto_value.rs b/crates/re_viewer/src/ui/editable_auto_value.rs index 583ad140362d..d9a355a2cecd 100644 --- a/crates/re_viewer/src/ui/editable_auto_value.rs +++ b/crates/re_viewer/src/ui/editable_auto_value.rs @@ -6,7 +6,7 @@ where T: Clone + Default + serde::Serialize, for<'de2> T: serde::Deserialize<'de2>, { - /// The user explicitely specified what they wanted + /// The user explicitly specified what they wanted UserEdited(T), /// The value is determined automatically. diff --git a/crates/re_viewer/src/ui/time_panel/time_ranges_ui.rs b/crates/re_viewer/src/ui/time_panel/time_ranges_ui.rs index 6dfdcaba95a4..560bb9d3b03b 100644 --- a/crates/re_viewer/src/ui/time_panel/time_ranges_ui.rs +++ b/crates/re_viewer/src/ui/time_panel/time_ranges_ui.rs @@ -243,13 +243,13 @@ impl TimeRangesUi { value } - // Make sure playback time doesn't get stuck between non-continuos regions: + // Make sure playback time doesn't get stuck between non-continuous regions: pub fn snap_time_control(&self, ctx: &mut ViewerContext<'_>) { if ctx.rec_cfg.time_ctrl.play_state() != PlayState::Playing { return; } - // Make sure time doesn't get stuck between non-continuos regions: + // Make sure time doesn't get stuck between non-continuous regions: if let Some(time) = ctx.rec_cfg.time_ctrl.time() { let time = self.snap_time_to_segments(time); ctx.rec_cfg.time_ctrl.set_time(time); diff --git a/crates/re_viewer/src/ui/view_spatial/eye.rs b/crates/re_viewer/src/ui/view_spatial/eye.rs index ec8305b189a1..be635da68570 100644 --- a/crates/re_viewer/src/ui/view_spatial/eye.rs +++ b/crates/re_viewer/src/ui/view_spatial/eye.rs @@ -289,7 +289,7 @@ impl OrbitEye { let new_radius = self.orbit_radius / factor; // Don't let radius go too small or too big because this might cause infinity/nan in some calculations. - // Max value is choosen with some generous margin of an observed crash due to infinity. + // Max value is chosen with some generous margin of an observed crash due to infinity. if f32::MIN_POSITIVE < new_radius && new_radius < 1.0e17 { self.orbit_radius = new_radius; } diff --git a/crates/re_viewer/src/ui/view_spatial/ui.rs b/crates/re_viewer/src/ui/view_spatial/ui.rs index feaff198f93f..495cf1895406 100644 --- a/crates/re_viewer/src/ui/view_spatial/ui.rs +++ b/crates/re_viewer/src/ui/view_spatial/ui.rs @@ -528,11 +528,11 @@ pub fn create_labels( .anchor_rect(egui::Rect::from_min_size(text_anchor_pos, galley.size())); let bg_rect = text_rect.expand2(egui::vec2(4.0, 2.0)); - let hightlight = highlights + let highlight = highlights .entity_highlight(label.labeled_instance.entity_path_hash) .index_highlight(label.labeled_instance.instance_key); - let fill_color = match hightlight.hover { - crate::misc::HoverHighlight::None => match hightlight.selection { + let fill_color = match highlight.hover { + crate::misc::HoverHighlight::None => match highlight.selection { SelectionHighlight::None => parent_ui.style().visuals.widgets.inactive.bg_fill, SelectionHighlight::SiblingSelection => { parent_ui.style().visuals.widgets.active.bg_fill diff --git a/crates/re_viewer/src/ui/view_time_series/scene.rs b/crates/re_viewer/src/ui/view_time_series/scene.rs index c15e9043435f..b530e9ccefc9 100644 --- a/crates/re_viewer/src/ui/view_time_series/scene.rs +++ b/crates/re_viewer/src/ui/view_time_series/scene.rs @@ -209,7 +209,7 @@ impl SceneTimeSeries { let prev_point = *prev_line.points.last().unwrap(); self.lines.push(prev_line); - // If the previous point was continous and the current point is continuous + // If the previous point was continuous and the current point is continuous // too, then we want the 2 segments to appear continuous even though they // are actually split from a data standpoint. let cur_continuous = matches!(kind, PlotSeriesKind::Continuous); diff --git a/crates/rerun/src/run.rs b/crates/rerun/src/run.rs index a6ecbadba787..da14be791588 100644 --- a/crates/rerun/src/run.rs +++ b/crates/rerun/src/run.rs @@ -286,7 +286,7 @@ async fn run_impl( let server_options = re_sdk_comms::ServerOptions { max_latency_sec: parse_max_latency(args.drop_at_latency.as_ref()), - // `rerun.spawn()` doesn't ned to log that a connection has been made + // `rerun.spawn()` doesn't need to log that a connection has been made quiet: call_source.is_python(), }; re_sdk_comms::serve(args.port, server_options)? diff --git a/examples/python/colmap/main.py b/examples/python/colmap/main.py index cda8fa58cb45..cb83a0e800ea 100755 --- a/examples/python/colmap/main.py +++ b/examples/python/colmap/main.py @@ -29,7 +29,7 @@ def scale_camera(camera: Camera, resize: Tuple[int, int]) -> Tuple[Camera, npt.N new_height = resize[1] scale_factor = np.array([new_width / camera.width, new_height / camera.height]) - # For PINHOLE camera modle, params are: [focal_length_x, focal_length_y, principal_point_x, principal_point_y] + # For PINHOLE camera model, params are: [focal_length_x, focal_length_y, principal_point_x, principal_point_y] new_params = np.append(camera.params[:2] * scale_factor, camera.params[2:] * scale_factor) return (Camera(camera.id, camera.model, new_width, new_height, new_params), scale_factor) diff --git a/examples/python/objectron/proto/a_r_capture_metadata.proto b/examples/python/objectron/proto/a_r_capture_metadata.proto index 4be6a2f7d27c..42e8d69ebef9 100644 --- a/examples/python/objectron/proto/a_r_capture_metadata.proto +++ b/examples/python/objectron/proto/a_r_capture_metadata.proto @@ -465,7 +465,7 @@ message CMDeviceMotion { optional CMCalibratedMagneticField magnetic_field = 5; // The rotation rate of the device adjusted by bias-removing Core Motion - // algoriths. + // algorithms. optional CMVector rotation_rate = 6; } diff --git a/examples/python/objectron/proto/object.proto b/examples/python/objectron/proto/object.proto index 2b51fe44dff5..e4d50883e869 100644 --- a/examples/python/objectron/proto/object.proto +++ b/examples/python/objectron/proto/object.proto @@ -12,7 +12,7 @@ message KeyPoint { float y = 2; float z = 3; - // Sphere around the keypoint, indiciating annotator's confidence of the + // Sphere around the keypoint, indicating annotator's confidence of the // position in meters. float confidence_radius = 4; @@ -99,7 +99,7 @@ message Skeleton { // Initialization value for all the keypoints in the skeleton in the object's // local coordinate system. Pursuit will transform these points using object's - // transformation to get the keypoint in the world-cooridnate. + // transformation to get the keypoint in the world-coordinate. repeated KeyPoint keypoints = 3; // List of edges connecting keypoints diff --git a/examples/python/objectron/proto/objectron/proto.py b/examples/python/objectron/proto/objectron/proto.py index be47422b6db3..114acf7f7b01 100644 --- a/examples/python/objectron/proto/objectron/proto.py +++ b/examples/python/objectron/proto/objectron/proto.py @@ -473,7 +473,7 @@ class CMDeviceMotion(betterproto.Message): # Returns the magnetic field vector filtered with respect to the device bias. magnetic_field: "CMCalibratedMagneticField" = betterproto.message_field(5) # The rotation rate of the device adjusted by bias-removing Core Motion - # algoriths. + # algorithms. rotation_rate: "CMVector" = betterproto.message_field(6) @@ -634,7 +634,7 @@ class KeyPoint(betterproto.Message): x: float = betterproto.float_field(1) y: float = betterproto.float_field(2) z: float = betterproto.float_field(3) - # Sphere around the keypoint, indiciating annotator's confidence of the + # Sphere around the keypoint, indicating annotator's confidence of the # position in meters. confidence_radius: float = betterproto.float_field(4) # The name of the keypoint (e.g. legs, head, etc.). Does not have to be @@ -700,7 +700,7 @@ class Skeleton(betterproto.Message): category: str = betterproto.string_field(2) # Initialization value for all the keypoints in the skeleton in the object's # local coordinate system. Pursuit will transform these points using object's - # transformation to get the keypoint in the world-cooridnate. + # transformation to get the keypoint in the world-coordinate. keypoints: List["KeyPoint"] = betterproto.message_field(3) # List of edges connecting keypoints edges: List["Edge"] = betterproto.message_field(4) diff --git a/examples/python/tracking_hf_opencv/main.py b/examples/python/tracking_hf_opencv/main.py index 5fce01057cc5..901755a26fdb 100755 --- a/examples/python/tracking_hf_opencv/main.py +++ b/examples/python/tracking_hf_opencv/main.py @@ -78,8 +78,8 @@ def detect_objects_to_track(self, rgb: npt.NDArray[np.uint8], frame_idx: int) -> logging.info("Looking for things to track on frame %d", frame_idx) logging.debug("Preprocess image for detection network") - pil_im_smal = Image.fromarray(rgb) - inputs = self.feature_extractor(images=pil_im_smal, return_tensors="pt") + pil_im_small = Image.fromarray(rgb) + inputs = self.feature_extractor(images=pil_im_small, return_tensors="pt") _, _, scaled_height, scaled_width = inputs["pixel_values"].shape scaled_size = (scaled_width, scaled_height) rgb_scaled = cv.resize(rgb, scaled_size) diff --git a/examples/rust/objectron/src/main.rs b/examples/rust/objectron/src/main.rs index 8da5b60fce79..1fef94787e48 100644 --- a/examples/rust/objectron/src/main.rs +++ b/examples/rust/objectron/src/main.rs @@ -177,7 +177,7 @@ fn log_ar_camera( let w = ar_camera.image_resolution_width.unwrap() as f32; let h = ar_camera.image_resolution_height.unwrap() as f32; - // The actual data is in portait (1440x1920), but the transforms assume landscape + // The actual data is in portrait (1440x1920), but the transforms assume landscape // input (1920x1440); we need to convert between the two. // See: // - https://github.com/google-research-datasets/Objectron/issues/39 @@ -187,7 +187,7 @@ fn log_ar_camera( intrinsics.z_axis = intrinsics.z_axis.yxz(); // swap w/h let resolution = glam::Vec2::new(h, w); - // rotate 90 degrees CCW around 2D plane normal (landscape -> portait) + // rotate 90 degrees CCW around 2D plane normal (landscape -> portrait) let rot = rot * glam::Quat::from_axis_angle(glam::Vec3::Z, std::f32::consts::TAU / 4.0); // TODO(cmc): I can't figure out why I need to do this let rot = rot * glam::Quat::from_axis_angle(glam::Vec3::X, std::f32::consts::TAU / 2.0); diff --git a/examples/rust/objectron/src/objectron.rs b/examples/rust/objectron/src/objectron.rs index 8cbd3145c12e..dc4d05b7fb38 100644 --- a/examples/rust/objectron/src/objectron.rs +++ b/examples/rust/objectron/src/objectron.rs @@ -870,7 +870,7 @@ pub struct CmDeviceMotion { #[prost(message, optional, tag = "5")] pub magnetic_field: ::core::option::Option, /// The rotation rate of the device adjusted by bias-removing Core Motion - /// algoriths. + /// algorithms. #[prost(message, optional, tag = "6")] pub rotation_rate: ::core::option::Option, } @@ -1124,7 +1124,7 @@ pub struct KeyPoint { pub y: f32, #[prost(float, tag = "3")] pub z: f32, - /// Sphere around the keypoint, indiciating annotator's confidence of the + /// Sphere around the keypoint, indicating annotator's confidence of the /// position in meters. #[prost(float, tag = "4")] pub confidence_radius: f32, @@ -1291,7 +1291,7 @@ pub struct Skeleton { pub category: ::prost::alloc::string::String, /// Initialization value for all the keypoints in the skeleton in the object's /// local coordinate system. Pursuit will transform these points using object's - /// transformation to get the keypoint in the world-cooridnate. + /// transformation to get the keypoint in the world-coordinate. #[prost(message, repeated, tag = "3")] pub keypoints: ::prost::alloc::vec::Vec, /// List of edges connecting keypoints diff --git a/rerun_py/rerun_sdk/rerun/__init__.py b/rerun_py/rerun_sdk/rerun/__init__.py index c17715b53ca8..93fbcec5c707 100644 --- a/rerun_py/rerun_sdk/rerun/__init__.py +++ b/rerun_py/rerun_sdk/rerun/__init__.py @@ -212,7 +212,7 @@ def set_enabled(enabled: bool) -> None: This is a global setting that affects all threads. - By default logging is enabled, but can be controlled with the enviornment variable `RERUN`, + By default logging is enabled, but can be controlled with the environment variable `RERUN`, (e.g. `RERUN=on` or `RERUN=off`). The default can be set in [`rerun.init`][]. diff --git a/rerun_py/rerun_sdk/rerun/log/__init__.py b/rerun_py/rerun_sdk/rerun/log/__init__.py index 8851e9f212ef..911d319de878 100644 --- a/rerun_py/rerun_sdk/rerun/log/__init__.py +++ b/rerun_py/rerun_sdk/rerun/log/__init__.py @@ -90,7 +90,7 @@ def log_cleared(entity_path: str, *, recursive: bool = False) -> None: bindings.log_cleared(entity_path, recursive) -def set_visible(entity_path: str, visibile: bool) -> None: +def set_visible(entity_path: str, visible: bool) -> None: """ set_visible has been deprecated. diff --git a/rerun_py/rerun_sdk/rerun/script_helpers.py b/rerun_py/rerun_sdk/rerun/script_helpers.py index 338ce710ade4..34a5e4c260bf 100644 --- a/rerun_py/rerun_sdk/rerun/script_helpers.py +++ b/rerun_py/rerun_sdk/rerun/script_helpers.py @@ -73,7 +73,7 @@ def script_setup( rr.serve() elif args.connect: # Send logging data to separate `rerun` process. - # You can ommit the argument to connect to the default address, + # You can omit the argument to connect to the default address, # which is `127.0.0.1:9876`. rr.connect(args.addr) elif args.save is not None: From df473b1df2144827e65e4d9699887bc48c5801e2 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 3 Mar 2023 10:20:44 +0100 Subject: [PATCH 3/5] Manually fix some more typos --- crates/re_arrow_store/src/store.rs | 2 +- crates/re_arrow_store/src/store_write.rs | 2 +- crates/re_log_types/src/component_types/context.rs | 2 +- crates/re_renderer/shader/depth_cloud.wgsl | 2 +- crates/re_renderer/src/renderer/lines.rs | 2 +- crates/re_viewer/src/app.rs | 4 ++-- crates/re_viewer/src/ui/time_panel/mod.rs | 2 +- design/data_model_3.md | 2 +- examples/python/colmap/read_write_model.py | 2 +- examples/python/tracking_hf_opencv/main.py | 2 +- rerun_py/docs/gen_common_index.py | 2 +- rerun_py/rerun_sdk/rerun/log/error_utils.py | 2 +- scripts/lint.py | 3 --- 13 files changed, 13 insertions(+), 16 deletions(-) diff --git a/crates/re_arrow_store/src/store.rs b/crates/re_arrow_store/src/store.rs index ed71329b448f..c31d3be17ae4 100644 --- a/crates/re_arrow_store/src/store.rs +++ b/crates/re_arrow_store/src/store.rs @@ -1222,7 +1222,7 @@ pub struct ComponentTable { /// Component buckets are append-only, they can never be written to in an out of order /// fashion. /// As such, a double-ended queue covers all our needs: - /// - poping from the front for garbage collection + /// - popping from the front for garbage collection /// - pushing to the back for insertions /// - binary search for queries pub(crate) buckets: VecDeque, diff --git a/crates/re_arrow_store/src/store_write.rs b/crates/re_arrow_store/src/store_write.rs index bd73eaad06a0..5b0e06bac623 100644 --- a/crates/re_arrow_store/src/store_write.rs +++ b/crates/re_arrow_store/src/store_write.rs @@ -1220,7 +1220,7 @@ impl ComponentBucket { debug_assert!( !self.archived, - "achiving an already archived bucket, something is likely wrong" + "archiving an already archived bucket, something is likely wrong" ); // Chunk compaction diff --git a/crates/re_log_types/src/component_types/context.rs b/crates/re_log_types/src/component_types/context.rs index d4c3f6256690..109f6f9256c8 100644 --- a/crates/re_log_types/src/component_types/context.rs +++ b/crates/re_log_types/src/component_types/context.rs @@ -36,7 +36,7 @@ pub struct AnnotationInfo { /// Keypoints within the class can also be decorated with skeletal edges. /// Keypoint-connections are pairs of [`KeypointId`]s. If an edge is /// defined, and both keypoints exist within the instance of the class, then the -/// keypoints shold be connected with an edge. The edge should be labeled and +/// keypoints should be connected with an edge. The edge should be labeled and /// colored as described by the class's [`AnnotationInfo`]. #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[derive(Clone, Debug, Default, PartialEq, Eq)] diff --git a/crates/re_renderer/shader/depth_cloud.wgsl b/crates/re_renderer/shader/depth_cloud.wgsl index 1b84adc4371b..49a22c4a8a75 100644 --- a/crates/re_renderer/shader/depth_cloud.wgsl +++ b/crates/re_renderer/shader/depth_cloud.wgsl @@ -106,7 +106,7 @@ fn fs_main(in: VertexOut) -> @location(0) Vec4 { // Sphere intersection with anti-aliasing as described by Iq here // https://www.shadertoy.com/view/MsSSWV - // (but rearranged and labled to it's easier to understand!) + // (but rearranged and labeled to it's easier to understand!) let d = ray_sphere_distance(ray_in_world, in.point_pos_in_world, in.point_radius); let smallest_distance_to_sphere = d.x; let closest_ray_dist = d.y; diff --git a/crates/re_renderer/src/renderer/lines.rs b/crates/re_renderer/src/renderer/lines.rs index 5902f84fc651..d3af9d4825ff 100644 --- a/crates/re_renderer/src/renderer/lines.rs +++ b/crates/re_renderer/src/renderer/lines.rs @@ -26,7 +26,7 @@ //! //! Data is provided in two separate textures, the "position data texture" and the "line strip texture". //! The "line strip texture" contains packed information over properties that are global to a single strip (see `gpu_data::LineStripInfo`) -//! Data in the "position data texture" is layed out a follows (see `gpu_data::PositionData`): +//! Data in the "position data texture" is laid out a follows (see `gpu_data::PositionData`): //! ```raw //! ___________________________________________________________________ //! position data | pos, strip_idx | pos, strip_idx | pos, strip_idx | pos, strip_idx | ... diff --git a/crates/re_viewer/src/app.rs b/crates/re_viewer/src/app.rs index c43cab2b3345..55f54de858c2 100644 --- a/crates/re_viewer/src/app.rs +++ b/crates/re_viewer/src/app.rs @@ -610,7 +610,7 @@ fn wait_screen_ui(ui: &mut egui::Ui, rx: &Receiver) { ready_and_waiting(ui, "Waiting for logging data from SDK"); } re_smart_channel::Source::WsClient { ws_server_url } => { - // TODO(emilk): it would be even better to know wether or not we are connected, or are attempting to connect + // TODO(emilk): it would be even better to know whether or not we are connected, or are attempting to connect ready_and_waiting(ui, &format!("Waiting for data from {ws_server_url}")); } re_smart_channel::Source::TcpServer { port } => { @@ -1381,7 +1381,7 @@ fn save_buttons_ui(ui: &mut egui::Ui, app: &mut App) { } // We need to know the loop selection _before_ we can even display the - // button, as this will determine wether its grayed out or not! + // button, as this will determine whether its grayed out or not! // TODO(cmc): In practice the loop (green) selection is always there // at the moment so... let loop_selection = app.loop_selection(); diff --git a/crates/re_viewer/src/ui/time_panel/mod.rs b/crates/re_viewer/src/ui/time_panel/mod.rs index e3609856e78a..1f4a52218bde 100644 --- a/crates/re_viewer/src/ui/time_panel/mod.rs +++ b/crates/re_viewer/src/ui/time_panel/mod.rs @@ -309,7 +309,7 @@ impl TimePanel { // In the design the shadow starts under the time markers. //let shadow_y_start = // timeline_rect.bottom() + ui.visuals().widgets.noninteractive.bg_stroke.width; - // This looks great but only if there are still time markes. + // This looks great but only if there are still time markers. // When they move to the right (or have a cut) one expects the shadow to go all the way up. // But that's quite complicated so let's have the shadow all the way let shadow_y_start = *full_y_range.start(); diff --git a/design/data_model_3.md b/design/data_model_3.md index 6bee8891eebc..a3b493a61565 100644 --- a/design/data_model_3.md +++ b/design/data_model_3.md @@ -7,7 +7,7 @@ Model 2 introduced the "batch" concept for efficiently logging and indexing larg It turned out this "batches overwrites previous values" was a hidden strength. For instance, if you do a bunch of detections in a camera frame, you can log all of their bboxes in a batch and next frame you overwrite all the detections from the previous frame by logging a new batch. -The "batch" used the last index of the data-path to distinguish between each instance. You would therefore log to a path with a placeholder index in the last index, e.g. `camera/"left"/points/*/.pos` where `*` is a placeholder meaning "here comes the whole batch". The hope was that this would make for simpler naming of data. That is, `camera/"left"/points/42/.pos` would work as an index wether or not the user chose to log `points` as a batch or individually. However, this special-treating of the last index position lead to rather a complicated implementation. It also is a bad abstraction: the paths _look_ the same, but they do not _act_ the same. +The "batch" used the last index of the data-path to distinguish between each instance. You would therefore log to a path with a placeholder index in the last index, e.g. `camera/"left"/points/*/.pos` where `*` is a placeholder meaning "here comes the whole batch". The hope was that this would make for simpler naming of data. That is, `camera/"left"/points/42/.pos` would work as an index whether or not the user chose to log `points` as a batch or individually. However, this special-treating of the last index position lead to rather a complicated implementation. It also is a bad abstraction: the paths _look_ the same, but they do not _act_ the same. To complicate things even further, we allowed some field of an object to be batched and others to be non-batched (e.g. log a batch os point cloud positions and then log their colors individually). diff --git a/examples/python/colmap/read_write_model.py b/examples/python/colmap/read_write_model.py index ec3667ec0f67..dd2043803d12 100644 --- a/examples/python/colmap/read_write_model.py +++ b/examples/python/colmap/read_write_model.py @@ -498,7 +498,7 @@ def main(): parser.add_argument("--input_model", help="path to input model folder") parser.add_argument("--input_format", choices=[".bin", ".txt"], help="input model format", default="") parser.add_argument("--output_model", help="path to output model folder") - parser.add_argument("--output_format", choices=[".bin", ".txt"], help="outut model format", default=".txt") + parser.add_argument("--output_format", choices=[".bin", ".txt"], help="output model format", default=".txt") args = parser.parse_args() cameras, images, points3D = read_model(path=args.input_model, ext=args.input_format) diff --git a/examples/python/tracking_hf_opencv/main.py b/examples/python/tracking_hf_opencv/main.py index 901755a26fdb..2c783d0ba341 100755 --- a/examples/python/tracking_hf_opencv/main.py +++ b/examples/python/tracking_hf_opencv/main.py @@ -209,7 +209,7 @@ def set_not_detected_in_frame(self) -> None: if self.num_recent_undetected_frames >= Tracker.MAX_TIMES_UNDETECTED: logging.info( - "Dropping tracker with id #%d after not beeing detected %d times", + "Dropping tracker with id #%d after not being detected %d times", self.tracking_id, self.num_recent_undetected_frames, ) diff --git a/rerun_py/docs/gen_common_index.py b/rerun_py/docs/gen_common_index.py index 061bda5e4c26..a63dc77f62a8 100644 --- a/rerun_py/docs/gen_common_index.py +++ b/rerun_py/docs/gen_common_index.py @@ -122,7 +122,7 @@ class Section: ), ] -# Virual folder where we will generate the md files +# Virtual folder where we will generate the md files root = Path(__file__).parent.parent.joinpath("rerun_sdk").resolve() common_dir = Path("common") diff --git a/rerun_py/rerun_sdk/rerun/log/error_utils.py b/rerun_py/rerun_sdk/rerun/log/error_utils.py index 63b2046f15f1..c8eade22833c 100644 --- a/rerun_py/rerun_sdk/rerun/log/error_utils.py +++ b/rerun_py/rerun_sdk/rerun/log/error_utils.py @@ -20,7 +20,7 @@ def _send_warning(message: str, depth_to_user_code: int) -> None: Sends a warning about the usage of the Rerun SDK. Used for recoverable problems. - You can also use this fo unrecoverable problems, + You can also use this for unrecoverable problems, or raise an exception and let the @log_decorator handle it instead. """ diff --git a/scripts/lint.py b/scripts/lint.py index 12eaa8f36022..1b64bc1d0981 100755 --- a/scripts/lint.py +++ b/scripts/lint.py @@ -50,9 +50,6 @@ def lint_line(line: str) -> Optional[str]: if todo_pattern.search(line): return "TODO:s should be written as `TODO(yourname): what to do`" - if "rerurn" in line.lower(): - return "Emil: you put an extra 'r' in 'Rerun' again!" - if "{err:?}" in line or "{err:#?}" in line or debug_format_of_err.search(line): return "Format errors with re_error::format or using Display - NOT Debug formatting!" From e09bd4ccfc1902d03ef410b34de6376a916be116 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 3 Mar 2023 15:50:40 +0100 Subject: [PATCH 4/5] document how to run typos locally --- _typos.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_typos.toml b/_typos.toml index c58655ae4c05..de3e6157207c 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,4 +1,6 @@ # https://github.com/crate-ci/typos +# install: cargo install typos-cli +# run: typos [default.extend-words] lod = "lod" # level-of-detail From 76271dd41f1b06d51bbd0f97c0986f2cca68430b Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 3 Mar 2023 15:50:48 +0100 Subject: [PATCH 5/5] fix doclink --- crates/re_build_info/src/build_info.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/re_build_info/src/build_info.rs b/crates/re_build_info/src/build_info.rs index 2e02f4f6ce36..487782a206f2 100644 --- a/crates/re_build_info/src/build_info.rs +++ b/crates/re_build_info/src/build_info.rs @@ -1,6 +1,6 @@ /// Information about the build of a Rust crate. /// -/// Create this with [`crate::build_info`]. +/// Create this with [`crate::build_info!`]. /// /// The `git_` fields are all empty on failure. Most likely git fails because we're not in a git repository /// to begin with, which happens because we've imported the published crate from crates.io.