Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip duplicates by default #218

Merged
merged 3 commits into from
Jan 19, 2025
Merged

Skip duplicates by default #218

merged 3 commits into from
Jan 19, 2025

Conversation

DanielVandH
Copy link
Member

@DanielVandH
Copy link
Member Author

DanielVandH commented Jan 18, 2025

@Kevin-Mattheus-Moerman
@EdsterG

This should address #215. What do you think of this? e.g. now

julia> points = [(1.0, 1.0), (2.0, 2.0), (5.5, 17.3), (1.0, 1.0), (0.0, 0.5), (1.7, 5.5), (2.0, 2.0), (2.0, 2.0), (25.5, 17.3), (5.5, 17.3)];

julia> triangulate(points)
┌ Warning: There were duplicate points. Only one of each duplicate will be used, and all other duplicates will be skipped. The indices of the duplicates are:
│   (1.0, 1.0) at indices [1, 4]
│   (2.0, 2.0) at indices [2, 7, 8]
│   (5.5, 17.3) at indices [3, 10]
│ To suppress this warning, call `DelaunayTriangulation.toggle_warn_on_dupes!()`.
└ @ DelaunayTriangulation C:\Users\djv23\.julia\dev\DelaunayTriangulation.jl\src\algorithms\triangulation\check_args.jl:122
Delaunay Triangulation.
   Number of vertices: 6
   Number of triangles: 6
   Number of edges: 11
   Has boundary nodes: false
   Has ghost triangles: true
   Curve-bounded: false
   Weighted: false
   Constrained: false

julia> DelaunayTriangulation.toggle_warn_on_dupes!()
false

julia> triangulate(points)
Delaunay Triangulation.
   Number of vertices: 6
   Number of triangles: 6
   Number of edges: 11
   Has boundary nodes: false
   Has ghost triangles: true
   Curve-bounded: false
   Weighted: false
   Constrained: false

julia> DelaunayTriangulation.has_vertex(triangulate(points), 1)
true

julia> DelaunayTriangulation.has_vertex(triangulate(points), 4)
false

@DanielVandH DanielVandH marked this pull request as ready for review January 18, 2025 21:54
@Kevin-Mattheus-Moerman
Copy link

Splendid 👏

Copy link

codecov bot commented Jan 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.82%. Comparing base (9134c8e) to head (aead02a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #218   +/-   ##
=======================================
  Coverage   94.82%   94.82%           
=======================================
  Files         102      102           
  Lines       10349    10355    +6     
=======================================
+ Hits         9813     9819    +6     
  Misses        536      536           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DanielVandH DanielVandH merged commit da9f582 into main Jan 19, 2025
8 checks passed
@DanielVandH DanielVandH deleted the duppts branch January 19, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants