natural-agi-common 0.1.34__tar.gz → 0.1.36__tar.gz

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.
Files changed (33) hide show
  1. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/PKG-INFO +1 -1
  2. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/traversal/visitors/angle_visitor.py +10 -4
  3. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/natural_agi_common.egg-info/PKG-INFO +1 -1
  4. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/setup.py +1 -1
  5. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/README.md +0 -0
  6. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/__init__.py +0 -0
  7. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/critical_graph_utils.py +0 -0
  8. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/critical_point.py +0 -0
  9. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/decorator.py +0 -0
  10. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/graph_utils.py +0 -0
  11. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/model/__init__.py +0 -0
  12. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/model/dlq.py +0 -0
  13. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/model/enums.py +0 -0
  14. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/model/half_plane.py +0 -0
  15. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/model/length_comparison_result.py +0 -0
  16. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/model/point.py +0 -0
  17. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/model/vector.py +0 -0
  18. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/params.py +0 -0
  19. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/traversal/__init__.py +0 -0
  20. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/traversal/graph_traversal.py +0 -0
  21. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/traversal/start_point_selector.py +0 -0
  22. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/traversal/visitors/__init__.py +0 -0
  23. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/traversal/visitors/direction_visitor.py +0 -0
  24. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/traversal/visitors/length_comparison_visitor.py +0 -0
  25. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/traversal/visitors/quadrant_visitor.py +0 -0
  26. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/traversal/visitors/visitor.py +0 -0
  27. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/common/traversal/visitors/visitor_result_persistence_service.py +0 -0
  28. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/natural_agi_common.egg-info/SOURCES.txt +0 -0
  29. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/natural_agi_common.egg-info/dependency_links.txt +0 -0
  30. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/natural_agi_common.egg-info/requires.txt +0 -0
  31. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/natural_agi_common.egg-info/top_level.txt +0 -0
  32. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/pyproject.toml +0 -0
  33. {natural_agi_common-0.1.34 → natural_agi_common-0.1.36}/setup.cfg +0 -0
@@ -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.36
4
4
  Requires-Dist: pydantic
5
5
  Requires-Dist: networkx
6
6
  Requires-Dist: neo4j
@@ -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.36
4
4
  Requires-Dist: pydantic
5
5
  Requires-Dist: networkx
6
6
  Requires-Dist: neo4j
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="natural-agi-common",
5
- version="0.1.34",
5
+ version="0.1.36",
6
6
  packages=find_packages(include=["common", "common.*"]),
7
7
  install_requires=["pydantic", "networkx", "neo4j"],
8
8
  )