Files
rfcp/backend/app/geometry/__init__.py
mytec defa3ad440 @mytec: feat: Phase 3.0 Architecture Refactor
Major refactoring of RFCP backend:
- Modular propagation models (8 models)
- SharedMemoryManager for terrain data
- ProcessPoolExecutor parallel processing
- WebSocket progress streaming
- Building filtering pipeline (351k → 15k)
- 82 unit tests

Performance: Standard preset 38s → 5s (7.6x speedup)

Known issue: Detailed preset timeout (fix in 3.1.0)
2026-02-01 23:12:26 +02:00

39 lines
1.7 KiB
Python

"""
Geometry operations for RF propagation calculations.
NumPy-dependent modules (haversine, intersection, reflection) are
imported lazily so pure-Python modules (diffraction, los) remain
available even when NumPy is not installed.
"""
from app.geometry.diffraction import knife_edge_loss
from app.geometry.los import check_los_terrain, fresnel_radius
def __getattr__(name):
"""Lazy import for NumPy-dependent geometry functions."""
_numpy_exports = {
"haversine_distance", "haversine_batch", "points_to_local_coords",
"line_segments_intersect_batch", "line_intersects_polygons_batch",
"calculate_reflection_points_batch", "find_best_reflection_path",
}
if name in _numpy_exports:
if name in ("haversine_distance", "haversine_batch", "points_to_local_coords"):
from app.geometry.haversine import haversine_distance, haversine_batch, points_to_local_coords
return locals()[name]
elif name in ("line_segments_intersect_batch", "line_intersects_polygons_batch"):
from app.geometry.intersection import line_segments_intersect_batch, line_intersects_polygons_batch
return locals()[name]
elif name in ("calculate_reflection_points_batch", "find_best_reflection_path"):
from app.geometry.reflection import calculate_reflection_points_batch, find_best_reflection_path
return locals()[name]
raise AttributeError(f"module 'app.geometry' has no attribute {name!r}")
__all__ = [
"haversine_distance", "haversine_batch", "points_to_local_coords",
"line_segments_intersect_batch", "line_intersects_polygons_batch",
"calculate_reflection_points_batch", "find_best_reflection_path",
"knife_edge_loss", "check_los_terrain", "fresnel_radius",
]