natural-agi-common 0.1.34__py3-none-any.whl → 0.1.35__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,8 +29,8 @@ class AngleVisitor(Visitor):
29
29
  return {"angles": angles, "point_id": point.id}
30
30
  return None
31
31
 
32
- def visit_line(self, line: Vector) -> Dict[str, Any]:
33
- angle_with_ox = self._calculate_angle_with_ox(line)
32
+ def visit_line(self, line: Vector, start_point: Point) -> Dict[str, Any]:
33
+ angle_with_ox = self._calculate_angle_with_ox(line, start_point)
34
34
  self.line_angles[line.id] = angle_with_ox
35
35
  self.graph.nodes[line.id]["angle_with_ox"] = angle_with_ox
36
36
  return {"angle_with_ox": angle_with_ox, "line_id": line.id}
@@ -159,8 +159,14 @@ class AngleVisitor(Visitor):
159
159
  angle2 = round(angle2 / 10) * 10
160
160
  return [angle1, angle2]
161
161
 
162
- def _calculate_angle_with_ox(self, line: Vector) -> float:
163
- vector = (line.x2 - line.x1, line.y2 - line.y1)
162
+ def _calculate_angle_with_ox(self, line: Vector, start_point: Point) -> float:
163
+ start_coords = (start_point.x, start_point.y)
164
+ end_coords = (
165
+ (line.x2, line.y2)
166
+ if line.x1 == start_point.x and line.y1 == start_point.y
167
+ else (line.x1, line.y1)
168
+ )
169
+ vector = (end_coords[0] - start_coords[0], end_coords[1] - start_coords[1])
164
170
  dot_product = vector[0] * 1 + vector[1] * 0
165
171
  magnitude = math.sqrt(vector[0] ** 2 + vector[1] ** 2)
166
172
  cos_angle = dot_product / magnitude
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: natural-agi-common
3
- Version: 0.1.34
3
+ Version: 0.1.35
4
4
  Requires-Dist: pydantic
5
5
  Requires-Dist: networkx
6
6
  Requires-Dist: neo4j
@@ -17,7 +17,7 @@ common/traversal/__init__.py,sha256=pkj_5-jsIbDoZbj2DyDePsuqICjuAJ2Rzahw-ezWqJk,
17
17
  common/traversal/graph_traversal.py,sha256=F_QBFYPyVckWkxjU-_Jos3WKSSUqaSOg1TbsU27PUPE,2535
18
18
  common/traversal/start_point_selector.py,sha256=saW8G3X3bEiXmZ_aTSCtb8hbquzae4qcaicyvsQ_mVw,4608
19
19
  common/traversal/visitors/__init__.py,sha256=ROshdBY3CJXJ3tV4xdgGv0OBok8cO4LATqroGah8vjY,639
20
- common/traversal/visitors/angle_visitor.py,sha256=2p-by7eQ1SQ4mXkqoVMtLxskBodRzJJpsP4WDKySdvU,6394
20
+ common/traversal/visitors/angle_visitor.py,sha256=UX3Hs0xlBBkpGRazH3NasMHy4Xk-LL3kiH8HvGvxF5c,6698
21
21
  common/traversal/visitors/direction_visitor.py,sha256=Dn4oPLmhEsL6EpWNC44X2FZU2sIoWMitEiQ5nBty2Po,5944
22
22
  common/traversal/visitors/half_plane_visitor.py,sha256=d1DUVtx4gH-dDhicTjN7lR69xvz2SXKQqaP6kzo3orM,2063
23
23
  common/traversal/visitors/length_comparison_visitor.py,sha256=hW56siLZodjsNWEFcyg9k0fclJLzT2ArneZCZZLVx9Y,2819
@@ -25,7 +25,7 @@ common/traversal/visitors/quadrant_visitor.py,sha256=N8Vb91FqtRYoQ2G9cK91KAfDaC7
25
25
  common/traversal/visitors/relative_position_visitor.py,sha256=3VfJWiuyvC9kc4C9F65LCJ7V4ecmbdz68KMahN2cOxc,7058
26
26
  common/traversal/visitors/visitor.py,sha256=30J0GEqzgeQrOng-rjPncXlcLE16WE7sqLlJ7-8SuwU,775
27
27
  common/traversal/visitors/visitor_result_persistence_service.py,sha256=lpr6KzZt22tjTpBnepbTMZ2gi9eLLNrojEv9ABTbvhE,760
28
- natural_agi_common-0.1.34.dist-info/METADATA,sha256=JBHcexQD76waYK9vvR8XRMpE7IlrXvyGH3hyKCnU_ZY,133
29
- natural_agi_common-0.1.34.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
30
- natural_agi_common-0.1.34.dist-info/top_level.txt,sha256=LOtYx8KZTmnxM_zLK4rwrcI3PRc40Ihwp5rgaQ-ceaI,7
31
- natural_agi_common-0.1.34.dist-info/RECORD,,
28
+ natural_agi_common-0.1.35.dist-info/METADATA,sha256=xQD5uBCX4sqV5FmFJEMFBccebMWIuu3xYNbE47gPQbY,133
29
+ natural_agi_common-0.1.35.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
30
+ natural_agi_common-0.1.35.dist-info/top_level.txt,sha256=LOtYx8KZTmnxM_zLK4rwrcI3PRc40Ihwp5rgaQ-ceaI,7
31
+ natural_agi_common-0.1.35.dist-info/RECORD,,