From 08933da4182082db5f9c9fa5eebc1f1c288f5187 Mon Sep 17 00:00:00 2001 From: Dario Panici Date: Thu, 6 Aug 2026 16:12:52 -0400 Subject: [PATCH] make non-planarity warning show quantitative error: --- desc/geometry/curve.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/desc/geometry/curve.py b/desc/geometry/curve.py index 01af58bb0b..54532ff336 100644 --- a/desc/geometry/curve.py +++ b/desc/geometry/curve.py @@ -928,7 +928,9 @@ def from_values(cls, coords, N=10, basis="xyz", name=""): warnif( np.max(np.abs(coords_rotated[:, 2])) > 1e-14, # check Z=0 for all points UserWarning, - "Curve values are not planar! Using the projection onto a plane.", + "Curve values are not planar! " + f"Max planarity violation of {np.max(np.abs(coords_rotated[:, 2])):1.2e} m." + " Using the projection onto a plane.", ) # polar angle @@ -1341,7 +1343,9 @@ def from_values(cls, coords, N=10, s=None, basis="xyz", name=""): warnif( np.max(np.abs(Z)) > 1e-14, # check that Z=0 for all points UserWarning, - "Curve values are not planar! Using the projection onto a plane.", + "Curve values are not planar! " + f"Max planarity violation of {np.max(np.abs(Z)):1.2e} m." + " Using the projection onto a plane.", ) if isinstance(s, str):