-
Notifications
You must be signed in to change notification settings - Fork 518
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
contrib.piecewise: Fixing a bug caused by degenerate simplices #2797
Conversation
…ing a DeveloperError when it appears that failed, warning user about points dropped in the triangulation
…ion, which means that later sorting the simplices means something.
…ices inside of each of the 8 cubes of the grid.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2797 +/- ##
=======================================
Coverage 87.01% 87.01%
=======================================
Files 763 763
Lines 87213 87229 +16
=======================================
+ Hits 75886 75901 +15
- Misses 11327 11328 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
…ck of where to place the blame and throwing either a ValueError or DeveloperError accordingly.
@@ -30,6 +33,8 @@ | |||
# be zero. | |||
ZERO_TOLERANCE = 1e-8 | |||
|
|||
logger = logging.getLogger('contrib.piecewise') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We love logging. Yes, we do.
Fixes # .
Summary/Motivation:
When we construct a
PiecewiseLinearFunction
from a set of points, a lot of times users will give us a grid. This means that the Delaunay triangulation is quite degenerate, so we get a lot of degenerate simplices back. This PR adds a check after calling the triangulation to filter out all simplices that are not full-dimensional.Changes proposed in this PR:
scipy.spatial.Delaunay
and keep only full-dimensional onesDeveloperError
when the linear system solve to find the hyperplane above a simplex is unexpectedly singular: this is a sign that we didn't correctly filter out degenerate simplices (in particular, it's possible we'll need a tolerance rather than keeping anything with a determinant that's not exactly 0.)Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: