docs(api): prefer builder-based fallible examples (#214) - #409
Conversation
- Present `DelaunayTriangulationBuilder` as the primary construction path while retaining `DelaunayTriangulation::new` as a legacy convenience constructor. - Replace doctest `unwrap()` patterns with typed `?` propagation and explicit optional guards across construction, validation, repair, geometry, and topology examples. - Re-export `DelaunayTriangulationBuilder` from `prelude::delaunayize` so single-prelude delaunayize examples can use the builder directly.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR migrates Rust doc examples and doctests across the repository to use DelaunayTriangulationBuilder for construction and Result/?-based example scaffolding, and adds a prelude re-export for the builder. ChangesBuilder API Documentation and Examples Refactoring
Estimated code review effort 🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 | 0 |
🟢 Coverage ∅ diff coverage · +0.01% coverage variation
Metric Results Coverage variation ✅ +0.01% coverage variation (-1.00%) Diff coverage ✅ ∅ diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (1789ceb) 62454 56531 90.52% Head commit (207ab3e) 62454 (+0) 56536 (+5) 90.52% (+0.01%) 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 (#409) 0 0 ∅ (not applicable) 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.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@src/geometry/algorithms/convex_hull.rs`:
- Around line 2005-2006: Update the doc comment to match the implementation:
instead of claiming the helper uses DelaunayTriangulationBuilder and returns a
reference to Triangulation, state that create_triangulation constructs and
returns a DelaunayTriangulation (built via
DelaunayTriangulation::with_kernel(...)). Mention the actual ownership return
type and the use of with_kernel rather than the builder so the comment aligns
with the create_triangulation implementation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: aef5905d-9e99-42f2-844f-191bfbc3168e
📒 Files selected for processing (45)
README.mddocs/api_design.mddocs/diagnostics.mddocs/numerical_robustness_guide.mddocs/validation.mddocs/workflows.mdsrc/core/adjacency.rssrc/core/algorithms/flips.rssrc/core/algorithms/incremental_insertion.rssrc/core/algorithms/locate.rssrc/core/boundary.rssrc/core/collections/key_maps.rssrc/core/collections/secondary_maps.rssrc/core/edge.rssrc/core/facet.rssrc/core/query.rssrc/core/repair.rssrc/core/simplex.rssrc/core/tds.rssrc/core/traits/boundary_analysis.rssrc/core/traits/facet_cache.rssrc/core/util/delaunay_validation.rssrc/core/util/facet_keys.rssrc/core/util/jaccard.rssrc/core/validation.rssrc/core/vertex.rssrc/delaunay/builder.rssrc/delaunay/construction.rssrc/delaunay/delaunayize.rssrc/delaunay/flips.rssrc/delaunay/insertion.rssrc/delaunay/query.rssrc/delaunay/repair.rssrc/delaunay/serialization.rssrc/delaunay/triangulation.rssrc/delaunay/validation.rssrc/geometry/algorithms/convex_hull.rssrc/geometry/quality.rssrc/geometry/util/measures.rssrc/geometry/util/triangulation_generation.rssrc/lib.rssrc/topology/characteristics/euler.rssrc/topology/characteristics/validation.rssrc/topology/manifold.rstests/prelude_exports.rs
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #409 +/- ##
=======================================
Coverage 90.50% 90.51%
=======================================
Files 71 71
Lines 62244 62244
=======================================
+ Hits 56335 56340 +5
+ Misses 5909 5904 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Update the `create_triangulation` helper comment to describe the owned `DelaunayTriangulation` return value and `with_kernel` construction path.
DelaunayTriangulationBuilderas the primary construction path while retainingDelaunayTriangulation::newas a legacy convenience constructor.unwrap()patterns with typed?propagation and explicit optional guards across construction, validation, repair, geometry, and topology examples.DelaunayTriangulationBuilderfromprelude::delaunayizeso single-prelude delaunayize examples can use the builder directly.