Changed: Removes CoordinateScalar bound from Cell, Tds, Vertex#193
Changed: Removes CoordinateScalar bound from Cell, Tds, Vertex#193acgetchell merged 2 commits intomainfrom
CoordinateScalar bound from Cell, Tds, Vertex#193Conversation
Relaxes trait bounds on `Cell`, `Tds`, and `Vertex` structs by removing the `CoordinateScalar` requirement. This change prepares the triangulation data structure for combinatorial operations independent of geometry. The `validate` method in `Tds` now requires `CoordinateScalar` to perform coordinate validation, where applicable. (Internal change).
WalkthroughRemoved the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/core/vertex.rs (1)
170-173:⚠️ Potential issue | 🟡 MinorStale doc: struct no longer requires
T: CoordinateScalar.The struct's
whereclause (line 186) now only requiresU: DataType, but the doc still states "Tmust implementCoordinateScalar". Consider rewording to reflect thatCoordinateScalaris required only for specific operations (serialization, validation, geometric methods), not at the type level.📝 Suggested doc update
/// # Constraints /// -/// - `T` must implement `CoordinateScalar` (floating-point operations, validation, etc.) +/// - `T` must implement `CoordinateScalar` for geometric operations, validation, and serialization +/// (the struct itself does not require it, enabling purely combinatorial use) /// - `U` must implement `DataType` (serialization, equality, hashing, etc.)
🧹 Nitpick comments (1)
src/core/vertex.rs (1)
504-507: Consider movingpoint()to the relaxed impl block.
point()is a pure field accessor (returns&self.point) with no dependency onCoordinateScalar. Moving it alongsideuuid()anddim()in the relaxedwhere U: DataTypeblock at line 207 would further the PR's goal of enabling combinatorial access without requiring coordinate-scalar bounds.♻️ Suggested move
impl<T, U, const D: usize> Vertex<T, U, D> where U: DataType, { /// Returns the UUID of the vertex. #[inline] pub const fn uuid(&self) -> Uuid { self.uuid } /// Returns the spatial dimension of the vertex. #[inline] pub const fn dim(&self) -> usize { D } + + /// Returns the point coordinates of the vertex. + #[inline] + pub const fn point(&self) -> &Point<T, D> { + &self.point + } }And remove
point()from theT: CoordinateScalarimpl block.
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #193 +/- ##
==========================================
+ Coverage 63.03% 63.05% +0.01%
==========================================
Files 46 46
Lines 10119 10119
==========================================
+ Hits 6379 6381 +2
+ Misses 3740 3738 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Clarifies the `Vertex` struct's constraints, emphasizing `CoordinateScalar` requirement for geometric operations and serialization but allowing combinatorial use without it. Moves the `point` method definition to ensure consistent API presentation. (Internal refactoring, no functional change). Refs: refactor/tds-combinatorial
Relaxes trait bounds on
Cell,Tds, andVertexstructs by removing theCoordinateScalarrequirement.This change prepares the triangulation data structure for combinatorial operations independent of geometry. The
validatemethod inTdsnow requiresCoordinateScalarto perform coordinate validation, where applicable. (Internal change).