From 5a99778de98cc58fd920a027d2aeb62a6c80df9a Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Thu, 15 Aug 2024 17:23:36 -0700 Subject: [PATCH] style(python2): Ensure __division__ is imported at the top of every file ... even those where there's no division happening (just in case). --- ladybug_geometry/_polyline.py | 1 + ladybug_geometry/dictutil.py | 1 + ladybug_geometry/geometry3d/plane.py | 2 +- ladybug_geometry/intersection2d.py | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ladybug_geometry/_polyline.py b/ladybug_geometry/_polyline.py index acde1d0f..d3520749 100644 --- a/ladybug_geometry/_polyline.py +++ b/ladybug_geometry/_polyline.py @@ -1,4 +1,5 @@ """Hidden utility functions used by both Polyline2D and Polyline3D classes.""" +from __future__ import division def _group_vertices(segments, tolerance): diff --git a/ladybug_geometry/dictutil.py b/ladybug_geometry/dictutil.py index 2f1ccabf..3413d851 100644 --- a/ladybug_geometry/dictutil.py +++ b/ladybug_geometry/dictutil.py @@ -5,6 +5,7 @@ Ladybug_geometry library in order to be able to re-serialize almost any dictionary produced from the library. """ +from __future__ import division from ladybug_geometry.geometry2d import Vector2D, Point2D, Ray2D, \ LineSegment2D, Arc2D, Polyline2D, Polygon2D, Mesh2D diff --git a/ladybug_geometry/geometry3d/plane.py b/ladybug_geometry/geometry3d/plane.py index 71d70f0b..e3c6a4e1 100644 --- a/ladybug_geometry/geometry3d/plane.py +++ b/ladybug_geometry/geometry3d/plane.py @@ -141,7 +141,7 @@ def y(self): @property def azimuth(self): """Get the azimuth of the plane. - + This is always between 0, indicating the positive Y-axis, and moving clockwise up to 2 * Pi, which indicates a return to the positive Y-axis. diff --git a/ladybug_geometry/intersection2d.py b/ladybug_geometry/intersection2d.py index 3273883e..1d18f73a 100644 --- a/ladybug_geometry/intersection2d.py +++ b/ladybug_geometry/intersection2d.py @@ -106,7 +106,7 @@ def intersect_line_segment2d(line_a, line_b): # compute the intersection point int_pta = Point2D(line_a.p.x + ua * line_a.v.x, line_a.p.y + ua * line_a.v.y) int_ptb = Point2D(line_b.p.x + ub * line_b.v.x, line_b.p.y + ub * line_b.v.y) - + # if the two points are unequal, there's a floating point tolerance issue if _isclose(int_pta.x, int_ptb.x) and _isclose(int_pta.y, int_ptb.y): return int_pta