From 27b4fb6e8ea9104f6bcb06098c45a479a8b31577 Mon Sep 17 00:00:00 2001 From: pilar Date: Tue, 19 May 2020 17:00:15 -0400 Subject: [PATCH] error detected in usage parsing --- .idea/inspectionProfiles/Project_Default.xml | 13 +++++++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/libs.iml | 8 ++++++++ .idea/modules.xml | 8 ++++++++ helpers/geometry.py | 19 +++++++++++++++++++ .../us_new_york_city_physics_parameters.py | 2 +- 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/libs.iml create mode 100644 .idea/modules.xml create mode 100644 helpers/geometry.py diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..69e6fdce --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 00000000..105ce2da --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/libs.iml b/.idea/libs.iml new file mode 100644 index 00000000..d0876a78 --- /dev/null +++ b/.idea/libs.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..560b1593 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/helpers/geometry.py b/helpers/geometry.py new file mode 100644 index 00000000..5474b531 --- /dev/null +++ b/helpers/geometry.py @@ -0,0 +1,19 @@ +import math +import numpy as np + + +class Geometry: + def __init__(self, delta=0.5): + self._delta = delta + + def almost_equal(self, v1, v2): + delta = math.sqrt(pow((v1[0]-v2[0]), 2) + pow((v1[1]-v2[1]), 2) + pow((v1[2]-v2[2]), 2)) + return delta <= self._delta + + @staticmethod + def to_points_matrix(points, remove_last=False): + rows = points.size//3 + points = points.reshape(rows, 3) + if remove_last: + points = np.delete(points, rows-1, 0) + return points diff --git a/physics/physics_feeders/us_new_york_city_physics_parameters.py b/physics/physics_feeders/us_new_york_city_physics_parameters.py index 7b9bfb3a..67b667ff 100644 --- a/physics/physics_feeders/us_new_york_city_physics_parameters.py +++ b/physics/physics_feeders/us_new_york_city_physics_parameters.py @@ -1,5 +1,5 @@ from physics.physics_feeders.us_base_physics_parameters import UsBasePhysicsParameters -from physics.physics_feeders.helpers.us_pluto_to_function import PlutoToFunction as Pf +from physics.physics_feeders.helpers.us_pluto_to_function import UsPlutoToFunction as Pf class UsNewYorkCityPhysicsParameters(UsBasePhysicsParameters):