tests/quadrilaterals.py

changeset 44
464f5e8d57ab
parent 32
75f44d3063da
child 45
7a7c237a1717
--- a/tests/quadrilaterals.py	Wed Jan 31 14:57:09 2018 +0200
+++ b/tests/quadrilaterals.py	Wed Jan 31 15:19:31 2018 +0200
@@ -58,16 +58,16 @@
                 if cross_product(b - a, c - a).length() < 1e-5:
                     yield error(element, 'collinearity-error')
 
-def hairline_score(smallest_angle):
+def hair_score(smallest_angle):
     from math import log10
     return max(0, -log10(smallest_angle))
 
-def hairline_test(model):
+def hair_test(model):
     for element in model.body:
         if hasattr(element, 'geometry') and len(element.geometry.vertices) >= 3:
             smallest_angle = element.geometry.smallest_angle
             if smallest_angle < radians(0.5):
-                yield notice(element, 'hairline-warning',
+                yield notice(element, 'hair-notice',
                     smallest_angle = smallest_angle,
                 )
 
@@ -77,7 +77,7 @@
         'concave': concave_test,
         'bowtie': bowtie_test,
         'collinearity': collinear_test,
-        'hairline': hairline_test,
+        'hair': hair_test,
     },
     'messages': {
         'skew-error': lambda skew_angle:
@@ -91,8 +91,8 @@
         'concave-error': 'concave quadrilateral',
         'self-intersecting': 'bowtie quadrilateral',
         'collinearity-error': 'collinear polygon',
-        'hairline-warning': lambda smallest_angle:
-            str.format('hairline polygon (smallest angle {})',
+        'hair-notice': lambda smallest_angle:
+            str.format('hair polygon (smallest angle {})',
                 degree_rep(smallest_angle),
             ),
     },

mercurial