Skip to content

Conversation

@m-reuter
Copy link
Member

@m-reuter m-reuter commented Jan 21, 2026

  • new function to compute critical points (minima, maxima and saddles)
  • more flexible polgyon now has auto-detect for closed loop inputs in cases where first and last point are the same
  • improved extraction of multiple level set components (closed and regular paths)

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 80.32787% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.02%. Comparing base (180c251) to head (0e39040).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lapy/tria_mesh.py 78.94% 21 Missing and 15 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #102      +/-   ##
==========================================
+ Coverage   44.53%   47.02%   +2.48%     
==========================================
  Files          15       15              
  Lines        2746     2856     +110     
  Branches      348      368      +20     
==========================================
+ Hits         1223     1343     +120     
+ Misses       1401     1377      -24     
- Partials      122      136      +14     
Flag Coverage Δ
unittests 47.02% <80.32%> (+2.48%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces several enhancements to the LaPy mesh processing library, focusing on critical point detection, level set extraction, and polygon handling. The changes add new functionality for identifying topological features (minima, maxima, saddles) on triangle meshes and improve the handling of level set curves, particularly closed loops.

Changes:

  • Added critical_points() method to identify extrema and saddle points on mesh surfaces
  • Enhanced Polygon class with auto-detection of closed loops when first/last points are identical
  • Refactored __reduce_edges_to_path() to handle multiple disconnected components and closed loops
  • Added extract_level_paths() method to extract multiple level set components as Polygon objects with metadata
  • Updated level_path() to use extract_level_paths() internally for consistency

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.

File Description
lapy/polygon.py Added optional closed parameter with auto-detection logic that removes duplicate endpoints
lapy/tria_mesh.py Added is_boundary(), critical_points(), and extract_level_paths() methods; refactored __reduce_edges_to_path() to handle multiple components and closed loops; updated level_path() implementation
lapy/utils/tests/test_tria_mesh.py Added comprehensive tests for critical_points, extract_level_paths, and level_path with various edge cases including closed loops and multiple components

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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