feat(api): add common Delaunay result alias - #470
Conversation
acgetchell
commented
Jun 19, 2026
- Add DelaunayError and DelaunayResult for common construction, insertion, validation, coordinate conversion, and toroidal-domain setup workflows.
- Re-export the aliases from the crate root and construction preludes for downstream examples and applications.
- Update public docs and examples to use DelaunayResult when workflow-specific errors are not required.
- Add DelaunayError and DelaunayResult for common construction, insertion, validation, coordinate conversion, and toroidal-domain setup workflows. - Re-export the aliases from the crate root and construction preludes for downstream examples and applications. - Update public docs and examples to use DelaunayResult when workflow-specific errors are not required.
WalkthroughIntroduces ChangesDelaunayError API and example standardization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 8 |
🟢 Coverage 100.00% diff coverage · +0.02% coverage variation
Metric Results Coverage variation ✅ +0.02% coverage variation (-1.00%) Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (b80d25a) 69016 63269 91.67% Head commit (98cc81e) 69017 (+1) 63281 (+12) 91.69% (+0.02%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#470) 1 1 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #470 +/- ##
==========================================
+ Coverage 91.64% 91.66% +0.01%
==========================================
Files 72 72
Lines 68796 68796
==========================================
+ Hits 63051 63062 +11
+ Misses 5745 5734 -11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
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)
docs/diagnostics.md (1)
71-87:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUse the
ResultAPI here instead ofis_valid().
validation_report()returnsResult<(), TriangulationValidationReport>, soreport.is_valid()will not compile in the doctest.Suggested fix
- let report = dt.validation_report(); - assert!(report.is_valid()); + assert!(dt.validation_report().is_ok());🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/diagnostics.md` around lines 71 - 87, The validation_report() method returns a Result type, not a value with an is_valid() method, so the current code will not compile. Replace the call to report.is_valid() with the appropriate Result API method report.is_ok() to properly check if the validation was successful, keeping it consistent with the validate() check performed earlier in the code.
🧹 Nitpick comments (2)
src/delaunay/validation.rs (1)
723-759: ⚡ Quick winUpdate the remaining doctest wrapper here.
This example still uses
ExampleError/thiserror, sovalidation.rsis only partially aligned with the newDelaunayResultpattern. Based on the PR objective to standardize examples onDelaunayResult.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/delaunay/validation.rs` around lines 723 - 759, The doctest example in this documentation comment still uses a custom ExampleError enum with thiserror instead of the standardized DelaunayResult pattern. Replace the custom ExampleError enum definition and change the main function signature to return DelaunayResult instead of Result<(), ExampleError>, then remove the individual error variant definitions for Construction, Serde, Validation, and Coordinate errors since DelaunayResult should handle all these error types automatically.src/delaunay/builder.rs (1)
1149-1250: ⚡ Quick winFinish the
DelaunayResultmigration here.These later doctests still define
ExampleErrorwiththiserror, so the builder docs are mixing two example styles. Based on the PR objective to standardize examples onDelaunayResult.Also applies to: 1491-1527
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/delaunay/builder.rs` around lines 1149 - 1250, The doctests in try_from_vertices_and_simplices and try_from_vertices_and_simplices_generic methods are still using the custom ExampleError enum with thiserror, which conflicts with the PR's goal to standardize on DelaunayResult. Replace the ExampleError enum definitions and main function signatures in both doctests to use DelaunayResult instead, removing the need for the custom error wrapper. Update the error handling patterns accordingly to align with the DelaunayResult style used elsewhere in the documentation, and apply the same migration pattern to any additional doctests in the 1491-1527 range mentioned in the comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@docs/diagnostics.md`:
- Around line 71-87: The validation_report() method returns a Result type, not a
value with an is_valid() method, so the current code will not compile. Replace
the call to report.is_valid() with the appropriate Result API method
report.is_ok() to properly check if the validation was successful, keeping it
consistent with the validate() check performed earlier in the code.
---
Nitpick comments:
In `@src/delaunay/builder.rs`:
- Around line 1149-1250: The doctests in try_from_vertices_and_simplices and
try_from_vertices_and_simplices_generic methods are still using the custom
ExampleError enum with thiserror, which conflicts with the PR's goal to
standardize on DelaunayResult. Replace the ExampleError enum definitions and
main function signatures in both doctests to use DelaunayResult instead,
removing the need for the custom error wrapper. Update the error handling
patterns accordingly to align with the DelaunayResult style used elsewhere in
the documentation, and apply the same migration pattern to any additional
doctests in the 1491-1527 range mentioned in the comment.
In `@src/delaunay/validation.rs`:
- Around line 723-759: The doctest example in this documentation comment still
uses a custom ExampleError enum with thiserror instead of the standardized
DelaunayResult pattern. Replace the custom ExampleError enum definition and
change the main function signature to return DelaunayResult instead of
Result<(), ExampleError>, then remove the individual error variant definitions
for Construction, Serde, Validation, and Coordinate errors since DelaunayResult
should handle all these error types automatically.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: c3883b65-93f4-469c-be75-83ea11e17651
📒 Files selected for processing (13)
README.mddocs/api_design.mddocs/dev/tooling-alignment.mddocs/diagnostics.mddocs/validation.mddocs/workflows.mdsrc/delaunay/builder.rssrc/delaunay/construction.rssrc/delaunay/insertion.rssrc/delaunay/triangulation.rssrc/delaunay/validation.rssrc/lib.rstests/prelude_exports.rs