refactor(worker): defer optional visualization imports
This commit is contained in:
+650
-273
@@ -1,278 +1,282 @@
|
|||||||
"""Host-owned compute handoff contracts."""
|
"""Host-owned compute handoff contracts."""
|
||||||
|
|
||||||
from .annotation_workspace import (
|
from importlib import import_module
|
||||||
ANNOTATION_WORKSPACE_SCHEMA,
|
from typing import TYPE_CHECKING, Any, Final
|
||||||
AnnotationWorkspace,
|
|
||||||
AnnotationWorkspaceError,
|
if TYPE_CHECKING:
|
||||||
prepare_annotation_workspace,
|
from .annotation_workspace import (
|
||||||
validate_annotation_workspace,
|
ANNOTATION_WORKSPACE_SCHEMA,
|
||||||
)
|
AnnotationWorkspace,
|
||||||
from .e31_source_qualification import (
|
AnnotationWorkspaceError,
|
||||||
DEFAULT_E31_SOURCE_QUALIFICATION_PROFILE,
|
prepare_annotation_workspace,
|
||||||
E31_BINDING_PROFILE_SCHEMA,
|
validate_annotation_workspace,
|
||||||
E31_SOURCE_QUALIFICATION_REPORT_SCHEMA,
|
)
|
||||||
E31_SOURCE_QUALIFICATION_SCHEMA,
|
from .e31_source_qualification import (
|
||||||
E31SourceQualification,
|
DEFAULT_E31_SOURCE_QUALIFICATION_PROFILE,
|
||||||
E31SourceQualificationError,
|
E31_BINDING_PROFILE_SCHEMA,
|
||||||
E31SourceQualificationProfile,
|
E31_SOURCE_QUALIFICATION_REPORT_SCHEMA,
|
||||||
build_e31_source_qualification,
|
E31_SOURCE_QUALIFICATION_SCHEMA,
|
||||||
)
|
E31SourceQualification,
|
||||||
from .e32_track_geometry_replay import (
|
E31SourceQualificationError,
|
||||||
E32_TRACK_GEOMETRY_RECORD_SCHEMA,
|
E31SourceQualificationProfile,
|
||||||
E32_TRACK_GEOMETRY_REPLAY_SCHEMA,
|
build_e31_source_qualification,
|
||||||
E32_TRACK_GEOMETRY_REPORT_SCHEMA,
|
)
|
||||||
E32TrackGeometryReplay,
|
from .e32_track_geometry_replay import (
|
||||||
E32TrackGeometryReplayError,
|
E32_TRACK_GEOMETRY_RECORD_SCHEMA,
|
||||||
build_e32_track_geometry_replay,
|
E32_TRACK_GEOMETRY_REPLAY_SCHEMA,
|
||||||
e32_track_geometry_frame,
|
E32_TRACK_GEOMETRY_REPORT_SCHEMA,
|
||||||
read_e32_track_geometry_replay,
|
E32TrackGeometryReplay,
|
||||||
)
|
E32TrackGeometryReplayError,
|
||||||
from .e33_worker_shadow import (
|
build_e32_track_geometry_replay,
|
||||||
E33_FRAME_SCHEMA,
|
e32_track_geometry_frame,
|
||||||
E33_OUTCOME_SCHEMA,
|
read_e32_track_geometry_replay,
|
||||||
E33_PACKAGE_SCHEMA,
|
)
|
||||||
E33_PROFILE_SCHEMA,
|
from .e33_worker_shadow import (
|
||||||
E33_REPORT_SCHEMA,
|
E33_FRAME_SCHEMA,
|
||||||
E33_RESOURCE_SCHEMA,
|
E33_OUTCOME_SCHEMA,
|
||||||
E33_RESULT_SCHEMA,
|
E33_PACKAGE_SCHEMA,
|
||||||
E33WorkerShadowError,
|
E33_PROFILE_SCHEMA,
|
||||||
E33WorkerShadowResult,
|
E33_REPORT_SCHEMA,
|
||||||
read_e33_worker_shadow_result,
|
E33_RESOURCE_SCHEMA,
|
||||||
run_e33_worker_shadow,
|
E33_RESULT_SCHEMA,
|
||||||
)
|
E33WorkerShadowError,
|
||||||
from .e51_motion_semantic_qualification import (
|
E33WorkerShadowResult,
|
||||||
E51_FRAME_SCHEMA,
|
read_e33_worker_shadow_result,
|
||||||
E51_PROFILE_SCHEMA,
|
run_e33_worker_shadow,
|
||||||
E51_REPORT_SCHEMA,
|
)
|
||||||
E51_RESULT_SCHEMA,
|
from .e51_motion_semantic_qualification import (
|
||||||
E51_SIGNAL_SCHEMA,
|
E51_FRAME_SCHEMA,
|
||||||
E51MotionSemanticError,
|
E51_PROFILE_SCHEMA,
|
||||||
E51MotionSemanticResult,
|
E51_REPORT_SCHEMA,
|
||||||
build_e51_motion_semantic_qualification,
|
E51_RESULT_SCHEMA,
|
||||||
derive_motion_semantic_signal,
|
E51_SIGNAL_SCHEMA,
|
||||||
read_e51_motion_semantic_qualification,
|
E51MotionSemanticError,
|
||||||
)
|
E51MotionSemanticResult,
|
||||||
from .e52_camera_first_restoration import (
|
build_e51_motion_semantic_qualification,
|
||||||
E52_CASE_SCHEMA,
|
derive_motion_semantic_signal,
|
||||||
E52_PROFILE_SCHEMA,
|
read_e51_motion_semantic_qualification,
|
||||||
E52_REPORT_SCHEMA,
|
)
|
||||||
E52_RESULT_SCHEMA,
|
from .e52_camera_first_restoration import (
|
||||||
E52CameraFirstRestoration,
|
E52_CASE_SCHEMA,
|
||||||
E52CameraFirstRestorationError,
|
E52_PROFILE_SCHEMA,
|
||||||
build_e52_camera_first_restoration,
|
E52_REPORT_SCHEMA,
|
||||||
evaluate_camera_first_case,
|
E52_RESULT_SCHEMA,
|
||||||
read_e52_camera_first_restoration,
|
E52CameraFirstRestoration,
|
||||||
)
|
E52CameraFirstRestorationError,
|
||||||
from .evaluation_pack import (
|
build_e52_camera_first_restoration,
|
||||||
ANNOTATION_CONTRACT_SCHEMA,
|
evaluate_camera_first_case,
|
||||||
EVALUATION_PACK_SCHEMA,
|
read_e52_camera_first_restoration,
|
||||||
EvaluationFrameRequest,
|
)
|
||||||
EvaluationPackFrame,
|
from .evaluation_pack import (
|
||||||
RecordedEvaluationPack,
|
ANNOTATION_CONTRACT_SCHEMA,
|
||||||
RecordedEvaluationPackError,
|
EVALUATION_PACK_SCHEMA,
|
||||||
prepare_recorded_evaluation_pack,
|
EvaluationFrameRequest,
|
||||||
validate_recorded_evaluation_pack,
|
EvaluationPackFrame,
|
||||||
)
|
RecordedEvaluationPack,
|
||||||
from .fusion_epoch import (
|
RecordedEvaluationPackError,
|
||||||
RecordedCalibratedFusion,
|
prepare_recorded_evaluation_pack,
|
||||||
RecordedCalibratedFusionStore,
|
validate_recorded_evaluation_pack,
|
||||||
RecordedPerceptionOverlayMux,
|
)
|
||||||
validate_recorded_calibrated_fusion,
|
from .fusion_epoch import (
|
||||||
)
|
RecordedCalibratedFusion,
|
||||||
from .integrated_perception import (
|
RecordedCalibratedFusionStore,
|
||||||
IntegratedPerceptionOverlayStore,
|
RecordedPerceptionOverlayMux,
|
||||||
IntegratedPerceptionResult,
|
validate_recorded_calibrated_fusion,
|
||||||
validate_integrated_perception_result,
|
)
|
||||||
)
|
from .integrated_perception import (
|
||||||
from .jobs import (
|
IntegratedPerceptionOverlayStore,
|
||||||
COMPUTE_JOB_SCHEMA,
|
IntegratedPerceptionResult,
|
||||||
CameraComputeJob,
|
validate_integrated_perception_result,
|
||||||
prepare_camera_compute_job,
|
)
|
||||||
validate_camera_compute_job,
|
from .jobs import (
|
||||||
)
|
COMPUTE_JOB_SCHEMA,
|
||||||
from .lab_instances import (
|
CameraComputeJob,
|
||||||
PublishedCameraEgoMotionLabInstance,
|
prepare_camera_compute_job,
|
||||||
PublishedIntegratedLabInstance,
|
validate_camera_compute_job,
|
||||||
PublishedPersistentSupportLabInstance,
|
)
|
||||||
PublishedTemporalLabInstance,
|
from .lab_instances import (
|
||||||
PublishedWorldMotionLabInstance,
|
PublishedCameraEgoMotionLabInstance,
|
||||||
publish_e21_lab_instance,
|
PublishedIntegratedLabInstance,
|
||||||
publish_e22_lab_instance,
|
PublishedPersistentSupportLabInstance,
|
||||||
publish_e23_lab_instance,
|
PublishedTemporalLabInstance,
|
||||||
publish_e24_lab_instance,
|
PublishedWorldMotionLabInstance,
|
||||||
publish_e25_lab_instance,
|
publish_e21_lab_instance,
|
||||||
publish_e26_lab_instance,
|
publish_e22_lab_instance,
|
||||||
publish_integrated_lab_instance,
|
publish_e23_lab_instance,
|
||||||
)
|
publish_e24_lab_instance,
|
||||||
from .lidar_contract import (
|
publish_e25_lab_instance,
|
||||||
K1_LAB_LIDAR_PACK_V1_PROFILE,
|
publish_e26_lab_instance,
|
||||||
K1_LIDAR_PACK_V2_PROFILE,
|
publish_integrated_lab_instance,
|
||||||
K1_LIVE_LIDAR_PROFILE,
|
)
|
||||||
LIDAR_EVIDENCE_PROFILE_SCHEMA,
|
from .lidar_contract import (
|
||||||
LIDAR_READINESS_SCHEMA,
|
K1_LAB_LIDAR_PACK_V1_PROFILE,
|
||||||
LidarContractError,
|
K1_LIDAR_PACK_V2_PROFILE,
|
||||||
LidarCoordinateSpace,
|
K1_LIVE_LIDAR_PROFILE,
|
||||||
LidarEvidenceProfile,
|
LIDAR_EVIDENCE_PROFILE_SCHEMA,
|
||||||
LidarPipelineStage,
|
LIDAR_READINESS_SCHEMA,
|
||||||
LidarPointField,
|
LidarContractError,
|
||||||
LidarPoseStatus,
|
LidarCoordinateSpace,
|
||||||
LidarQualityMonitor,
|
LidarEvidenceProfile,
|
||||||
LidarReadiness,
|
LidarPipelineStage,
|
||||||
LidarRepresentation,
|
LidarPointField,
|
||||||
LidarStageAssessment,
|
LidarPoseStatus,
|
||||||
LidarTimeBasis,
|
LidarQualityMonitor,
|
||||||
assess_lidar_profile,
|
LidarReadiness,
|
||||||
lidar_readiness_document,
|
LidarRepresentation,
|
||||||
sensor_frame_xyzi,
|
LidarStageAssessment,
|
||||||
)
|
LidarTimeBasis,
|
||||||
from .lidar_field_review import (
|
assess_lidar_profile,
|
||||||
E10_LIDAR_PACK_SCHEMA,
|
lidar_readiness_document,
|
||||||
FIELD_REVIEW_ARRAYS_NAME,
|
sensor_frame_xyzi,
|
||||||
FIELD_REVIEW_MANIFEST_NAME,
|
)
|
||||||
FIELD_REVIEW_REPORT_NAME,
|
from .lidar_field_review import (
|
||||||
LIDAR_FIELD_REVIEW_REPORT_SCHEMA,
|
E10_LIDAR_PACK_SCHEMA,
|
||||||
LIDAR_FIELD_REVIEW_SCHEMA,
|
FIELD_REVIEW_ARRAYS_NAME,
|
||||||
LIDAR_FIELD_REVIEW_WINDOW_SCHEMA,
|
FIELD_REVIEW_MANIFEST_NAME,
|
||||||
MAX_FIELD_REVIEW_WINDOW_POINTS,
|
FIELD_REVIEW_REPORT_NAME,
|
||||||
RAVNOVES00_CENTRAL_WINDOWS,
|
LIDAR_FIELD_REVIEW_REPORT_SCHEMA,
|
||||||
E10LidarFieldSource,
|
LIDAR_FIELD_REVIEW_SCHEMA,
|
||||||
FieldReviewWindowSpec,
|
LIDAR_FIELD_REVIEW_WINDOW_SCHEMA,
|
||||||
LidarFieldReviewV1,
|
MAX_FIELD_REVIEW_WINDOW_POINTS,
|
||||||
build_lidar_field_review,
|
RAVNOVES00_CENTRAL_WINDOWS,
|
||||||
lidar_field_review_catalog_item,
|
E10LidarFieldSource,
|
||||||
)
|
FieldReviewWindowSpec,
|
||||||
from .lidar_ground import (
|
LidarFieldReviewV1,
|
||||||
DEFAULT_GROUND_BENCHMARK_PROFILE,
|
build_lidar_field_review,
|
||||||
LIDAR_GROUND_ANNOTATION_TEMPLATE_SCHEMA,
|
lidar_field_review_catalog_item,
|
||||||
LIDAR_GROUND_BENCHMARK_REPORT_SCHEMA,
|
)
|
||||||
LIDAR_GROUND_BENCHMARK_SCHEMA,
|
from .lidar_ground import (
|
||||||
LIDAR_GROUND_FRAME_SCHEMA,
|
DEFAULT_GROUND_BENCHMARK_PROFILE,
|
||||||
PATCHWORKPP_SOURCE_COMMIT,
|
LIDAR_GROUND_ANNOTATION_TEMPLATE_SCHEMA,
|
||||||
PATCHWORKPP_SOURCE_TAG,
|
LIDAR_GROUND_BENCHMARK_REPORT_SCHEMA,
|
||||||
PATCHWORKPP_SOURCE_URL,
|
LIDAR_GROUND_BENCHMARK_SCHEMA,
|
||||||
GroundBenchmarkProfile,
|
LIDAR_GROUND_FRAME_SCHEMA,
|
||||||
GroundSegmentation,
|
PATCHWORKPP_SOURCE_COMMIT,
|
||||||
LidarGroundBenchmarkV1,
|
PATCHWORKPP_SOURCE_TAG,
|
||||||
LidarGroundError,
|
PATCHWORKPP_SOURCE_URL,
|
||||||
LocalPercentileGroundSegmenter,
|
GroundBenchmarkProfile,
|
||||||
PatchworkPPGroundSegmenter,
|
GroundSegmentation,
|
||||||
build_lidar_ground_annotation_template,
|
LidarGroundBenchmarkV1,
|
||||||
build_lidar_ground_benchmark,
|
LidarGroundError,
|
||||||
lidar_ground_benchmark_catalog_item,
|
LocalPercentileGroundSegmenter,
|
||||||
lidar_ground_frame_detail,
|
PatchworkPPGroundSegmenter,
|
||||||
score_ground_labels,
|
build_lidar_ground_annotation_template,
|
||||||
)
|
build_lidar_ground_benchmark,
|
||||||
from .lidar_local_surface import (
|
lidar_ground_benchmark_catalog_item,
|
||||||
DEFAULT_K1_LOCAL_SURFACE_PROFILE,
|
lidar_ground_frame_detail,
|
||||||
K1_LOCAL_SURFACE_FRAME_SCHEMA,
|
score_ground_labels,
|
||||||
K1_LOCAL_SURFACE_REPORT_SCHEMA,
|
)
|
||||||
K1_LOCAL_SURFACE_REVIEW_SCHEMA,
|
from .lidar_local_surface import (
|
||||||
K1_LOCAL_SURFACE_SCHEMA,
|
DEFAULT_K1_LOCAL_SURFACE_PROFILE,
|
||||||
K1_LOCAL_SURFACE_TIMELINE_SCHEMA,
|
K1_LOCAL_SURFACE_FRAME_SCHEMA,
|
||||||
K1LocalSurfaceProfile,
|
K1_LOCAL_SURFACE_REPORT_SCHEMA,
|
||||||
K1LocalSurfaceV1,
|
K1_LOCAL_SURFACE_REVIEW_SCHEMA,
|
||||||
build_k1_local_surface,
|
K1_LOCAL_SURFACE_SCHEMA,
|
||||||
k1_local_surface_catalog_item,
|
K1_LOCAL_SURFACE_TIMELINE_SCHEMA,
|
||||||
)
|
K1LocalSurfaceProfile,
|
||||||
from .lidar_local_surface_shadow import (
|
K1LocalSurfaceV1,
|
||||||
K1_LOCAL_SURFACE_BINDER_SCHEMA,
|
build_k1_local_surface,
|
||||||
K1_LOCAL_SURFACE_SHADOW_FRAME_SCHEMA,
|
k1_local_surface_catalog_item,
|
||||||
K1_LOCAL_SURFACE_SHADOW_SCHEMA,
|
)
|
||||||
K1LocalSurfaceBoundViews,
|
from .lidar_local_surface_shadow import (
|
||||||
K1LocalSurfacePoseBinder,
|
K1_LOCAL_SURFACE_BINDER_SCHEMA,
|
||||||
K1LocalSurfaceShadowCoordinator,
|
K1_LOCAL_SURFACE_SHADOW_FRAME_SCHEMA,
|
||||||
K1LocalSurfaceShadowEstimator,
|
K1_LOCAL_SURFACE_SHADOW_SCHEMA,
|
||||||
K1LocalSurfaceShadowInput,
|
K1LocalSurfaceBoundViews,
|
||||||
K1LocalSurfaceShadowResult,
|
K1LocalSurfacePoseBinder,
|
||||||
K1LocalSurfaceShadowRuntime,
|
K1LocalSurfaceShadowCoordinator,
|
||||||
)
|
K1LocalSurfaceShadowEstimator,
|
||||||
from .lidar_replay import (
|
K1LocalSurfaceShadowInput,
|
||||||
LIDAR_EQUIVALENCE_REPORT_SCHEMA,
|
K1LocalSurfaceShadowResult,
|
||||||
LIDAR_QUALITY_REPORT_SCHEMA,
|
K1LocalSurfaceShadowRuntime,
|
||||||
LIDAR_REPLAY_PACK_SCHEMA,
|
)
|
||||||
LidarReplayError,
|
from .lidar_replay import (
|
||||||
LidarReplayPackV2,
|
LIDAR_EQUIVALENCE_REPORT_SCHEMA,
|
||||||
LidarReplayPointFrame,
|
LIDAR_QUALITY_REPORT_SCHEMA,
|
||||||
LidarReplayPoseFrame,
|
LIDAR_REPLAY_PACK_SCHEMA,
|
||||||
build_lidar_replay_pack_v2,
|
LidarReplayError,
|
||||||
lidar_pack_catalog_item,
|
LidarReplayPackV2,
|
||||||
lidar_pack_detail,
|
LidarReplayPointFrame,
|
||||||
verify_lidar_replay_equivalence,
|
LidarReplayPoseFrame,
|
||||||
)
|
build_lidar_replay_pack_v2,
|
||||||
from .live_perception import (
|
lidar_pack_catalog_item,
|
||||||
LIVE_INGRESS_SCHEMA,
|
lidar_pack_detail,
|
||||||
LIVE_INGRESS_WIRE_SCHEMA,
|
verify_lidar_replay_equivalence,
|
||||||
TELEMETRY_SCHEMA,
|
)
|
||||||
WORLD_STATE_SCHEMA,
|
from .live_perception import (
|
||||||
LatestWinsQueue,
|
LIVE_INGRESS_SCHEMA,
|
||||||
LiveIngressEvent,
|
LIVE_INGRESS_WIRE_SCHEMA,
|
||||||
LivePerceptionIngress,
|
TELEMETRY_SCHEMA,
|
||||||
QueueSnapshot,
|
WORLD_STATE_SCHEMA,
|
||||||
WorldStateProjector,
|
LatestWinsQueue,
|
||||||
classify_health,
|
LiveIngressEvent,
|
||||||
)
|
LivePerceptionIngress,
|
||||||
from .live_replay_qualification import (
|
QueueSnapshot,
|
||||||
LiveReplayQualificationResult,
|
WorldStateProjector,
|
||||||
validate_live_replay_qualification_result,
|
classify_health,
|
||||||
)
|
)
|
||||||
from .multirate_perception_qualification import (
|
from .live_replay_qualification import (
|
||||||
MultiratePerceptionArtifact,
|
LiveReplayQualificationResult,
|
||||||
MultiratePerceptionQualificationResult,
|
validate_live_replay_qualification_result,
|
||||||
validate_multirate_perception_qualification_result,
|
)
|
||||||
)
|
from .multirate_perception_qualification import (
|
||||||
from .perception_epoch import (
|
MultiratePerceptionArtifact,
|
||||||
RecordedPerceptionEpochResult,
|
MultiratePerceptionQualificationResult,
|
||||||
RecordedPerceptionEpochStore,
|
validate_multirate_perception_qualification_result,
|
||||||
RecordedPerceptionVideo,
|
)
|
||||||
validate_recorded_perception_epoch_result,
|
from .perception_epoch import (
|
||||||
)
|
RecordedPerceptionEpochResult,
|
||||||
from .qualification import (
|
RecordedPerceptionEpochStore,
|
||||||
DEFAULT_QUALIFICATION_FRAME_COUNT,
|
RecordedPerceptionVideo,
|
||||||
QUALIFICATION_POLICY,
|
validate_recorded_perception_epoch_result,
|
||||||
QualificationFrame,
|
)
|
||||||
RecordedQualificationSlice,
|
from .qualification import (
|
||||||
RecordedQualificationSliceError,
|
DEFAULT_QUALIFICATION_FRAME_COUNT,
|
||||||
prepare_recorded_qualification_slice,
|
QUALIFICATION_POLICY,
|
||||||
validate_recorded_qualification_slice,
|
QualificationFrame,
|
||||||
)
|
RecordedQualificationSlice,
|
||||||
from .realtime_tracking_qualification import (
|
RecordedQualificationSliceError,
|
||||||
RealtimeTrackingArtifact,
|
prepare_recorded_qualification_slice,
|
||||||
RealtimeTrackingQualificationResult,
|
validate_recorded_qualification_slice,
|
||||||
validate_realtime_tracking_qualification_result,
|
)
|
||||||
)
|
from .realtime_tracking_qualification import (
|
||||||
from .results import (
|
RealtimeTrackingArtifact,
|
||||||
DetectionFrame,
|
RealtimeTrackingQualificationResult,
|
||||||
ObjectDetection,
|
validate_realtime_tracking_qualification_result,
|
||||||
RecordedPerceptionOverlayArtifact,
|
)
|
||||||
RecordedPerceptionOverlayError,
|
from .results import (
|
||||||
RecordedPerceptionOverlayStore,
|
DetectionFrame,
|
||||||
RecordedPerceptionResult,
|
ObjectDetection,
|
||||||
validate_recorded_perception_result,
|
RecordedPerceptionOverlayArtifact,
|
||||||
)
|
RecordedPerceptionOverlayError,
|
||||||
from .track_geometry import (
|
RecordedPerceptionOverlayStore,
|
||||||
POINT_SLAB_SCHEMA,
|
RecordedPerceptionResult,
|
||||||
TRACK_GEOMETRY_BINDING_SCHEMA,
|
validate_recorded_perception_result,
|
||||||
TRACK_GEOMETRY_FRAME_SCHEMA,
|
)
|
||||||
TRACK_GEOMETRY_SCHEMA,
|
from .track_geometry import (
|
||||||
PointSlab,
|
POINT_SLAB_SCHEMA,
|
||||||
TrackGeometry,
|
TRACK_GEOMETRY_BINDING_SCHEMA,
|
||||||
TrackGeometryContractError,
|
TRACK_GEOMETRY_FRAME_SCHEMA,
|
||||||
TrackGeometryCurrentness,
|
TRACK_GEOMETRY_SCHEMA,
|
||||||
TrackGeometryEvidenceState,
|
PointSlab,
|
||||||
TrackGeometryFrame,
|
TrackGeometry,
|
||||||
TrackGeometryMetricBasis,
|
TrackGeometryContractError,
|
||||||
TrackGeometryOwnerKind,
|
TrackGeometryCurrentness,
|
||||||
TrackGeometrySourceBinding,
|
TrackGeometryEvidenceState,
|
||||||
)
|
TrackGeometryFrame,
|
||||||
from .tracked_fusion_qualification import (
|
TrackGeometryMetricBasis,
|
||||||
TrackedFusionQualificationResult,
|
TrackGeometryOwnerKind,
|
||||||
validate_tracked_fusion_qualification_result,
|
TrackGeometrySourceBinding,
|
||||||
)
|
)
|
||||||
from .tracking_qualification import (
|
from .tracked_fusion_qualification import (
|
||||||
TrackingQualificationArtifact,
|
TrackedFusionQualificationResult,
|
||||||
TrackingQualificationResult,
|
validate_tracked_fusion_qualification_result,
|
||||||
validate_tracking_qualification_result,
|
)
|
||||||
)
|
from .tracking_qualification import (
|
||||||
|
TrackingQualificationArtifact,
|
||||||
|
TrackingQualificationResult,
|
||||||
|
validate_tracking_qualification_result,
|
||||||
|
)
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"ANNOTATION_CONTRACT_SCHEMA",
|
"ANNOTATION_CONTRACT_SCHEMA",
|
||||||
@@ -495,3 +499,376 @@ __all__ = [
|
|||||||
"sensor_frame_xyzi",
|
"sensor_frame_xyzi",
|
||||||
"verify_lidar_replay_equivalence",
|
"verify_lidar_replay_equivalence",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
_EXPORTS: Final[dict[str, str]] = {
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"ANNOTATION_WORKSPACE_SCHEMA",
|
||||||
|
"AnnotationWorkspace",
|
||||||
|
"AnnotationWorkspaceError",
|
||||||
|
"prepare_annotation_workspace",
|
||||||
|
"validate_annotation_workspace",
|
||||||
|
),
|
||||||
|
".annotation_workspace",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"DEFAULT_E31_SOURCE_QUALIFICATION_PROFILE",
|
||||||
|
"E31_BINDING_PROFILE_SCHEMA",
|
||||||
|
"E31_SOURCE_QUALIFICATION_REPORT_SCHEMA",
|
||||||
|
"E31_SOURCE_QUALIFICATION_SCHEMA",
|
||||||
|
"E31SourceQualification",
|
||||||
|
"E31SourceQualificationError",
|
||||||
|
"E31SourceQualificationProfile",
|
||||||
|
"build_e31_source_qualification",
|
||||||
|
),
|
||||||
|
".e31_source_qualification",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"E32_TRACK_GEOMETRY_RECORD_SCHEMA",
|
||||||
|
"E32_TRACK_GEOMETRY_REPLAY_SCHEMA",
|
||||||
|
"E32_TRACK_GEOMETRY_REPORT_SCHEMA",
|
||||||
|
"E32TrackGeometryReplay",
|
||||||
|
"E32TrackGeometryReplayError",
|
||||||
|
"build_e32_track_geometry_replay",
|
||||||
|
"e32_track_geometry_frame",
|
||||||
|
"read_e32_track_geometry_replay",
|
||||||
|
),
|
||||||
|
".e32_track_geometry_replay",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"E33_FRAME_SCHEMA",
|
||||||
|
"E33_OUTCOME_SCHEMA",
|
||||||
|
"E33_PACKAGE_SCHEMA",
|
||||||
|
"E33_PROFILE_SCHEMA",
|
||||||
|
"E33_REPORT_SCHEMA",
|
||||||
|
"E33_RESOURCE_SCHEMA",
|
||||||
|
"E33_RESULT_SCHEMA",
|
||||||
|
"E33WorkerShadowError",
|
||||||
|
"E33WorkerShadowResult",
|
||||||
|
"read_e33_worker_shadow_result",
|
||||||
|
"run_e33_worker_shadow",
|
||||||
|
),
|
||||||
|
".e33_worker_shadow",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"E51_FRAME_SCHEMA",
|
||||||
|
"E51_PROFILE_SCHEMA",
|
||||||
|
"E51_REPORT_SCHEMA",
|
||||||
|
"E51_RESULT_SCHEMA",
|
||||||
|
"E51_SIGNAL_SCHEMA",
|
||||||
|
"E51MotionSemanticError",
|
||||||
|
"E51MotionSemanticResult",
|
||||||
|
"build_e51_motion_semantic_qualification",
|
||||||
|
"derive_motion_semantic_signal",
|
||||||
|
"read_e51_motion_semantic_qualification",
|
||||||
|
),
|
||||||
|
".e51_motion_semantic_qualification",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"E52_CASE_SCHEMA",
|
||||||
|
"E52_PROFILE_SCHEMA",
|
||||||
|
"E52_REPORT_SCHEMA",
|
||||||
|
"E52_RESULT_SCHEMA",
|
||||||
|
"E52CameraFirstRestoration",
|
||||||
|
"E52CameraFirstRestorationError",
|
||||||
|
"build_e52_camera_first_restoration",
|
||||||
|
"evaluate_camera_first_case",
|
||||||
|
"read_e52_camera_first_restoration",
|
||||||
|
),
|
||||||
|
".e52_camera_first_restoration",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"ANNOTATION_CONTRACT_SCHEMA",
|
||||||
|
"EVALUATION_PACK_SCHEMA",
|
||||||
|
"EvaluationFrameRequest",
|
||||||
|
"EvaluationPackFrame",
|
||||||
|
"RecordedEvaluationPack",
|
||||||
|
"RecordedEvaluationPackError",
|
||||||
|
"prepare_recorded_evaluation_pack",
|
||||||
|
"validate_recorded_evaluation_pack",
|
||||||
|
),
|
||||||
|
".evaluation_pack",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"RecordedCalibratedFusion",
|
||||||
|
"RecordedCalibratedFusionStore",
|
||||||
|
"RecordedPerceptionOverlayMux",
|
||||||
|
"validate_recorded_calibrated_fusion",
|
||||||
|
),
|
||||||
|
".fusion_epoch",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"IntegratedPerceptionOverlayStore",
|
||||||
|
"IntegratedPerceptionResult",
|
||||||
|
"validate_integrated_perception_result",
|
||||||
|
),
|
||||||
|
".integrated_perception",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"COMPUTE_JOB_SCHEMA",
|
||||||
|
"CameraComputeJob",
|
||||||
|
"prepare_camera_compute_job",
|
||||||
|
"validate_camera_compute_job",
|
||||||
|
),
|
||||||
|
".jobs",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"PublishedCameraEgoMotionLabInstance",
|
||||||
|
"PublishedIntegratedLabInstance",
|
||||||
|
"PublishedPersistentSupportLabInstance",
|
||||||
|
"PublishedTemporalLabInstance",
|
||||||
|
"PublishedWorldMotionLabInstance",
|
||||||
|
"publish_e21_lab_instance",
|
||||||
|
"publish_e22_lab_instance",
|
||||||
|
"publish_e23_lab_instance",
|
||||||
|
"publish_e24_lab_instance",
|
||||||
|
"publish_e25_lab_instance",
|
||||||
|
"publish_e26_lab_instance",
|
||||||
|
"publish_integrated_lab_instance",
|
||||||
|
),
|
||||||
|
".lab_instances",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"K1_LAB_LIDAR_PACK_V1_PROFILE",
|
||||||
|
"K1_LIDAR_PACK_V2_PROFILE",
|
||||||
|
"K1_LIVE_LIDAR_PROFILE",
|
||||||
|
"LIDAR_EVIDENCE_PROFILE_SCHEMA",
|
||||||
|
"LIDAR_READINESS_SCHEMA",
|
||||||
|
"LidarContractError",
|
||||||
|
"LidarCoordinateSpace",
|
||||||
|
"LidarEvidenceProfile",
|
||||||
|
"LidarPipelineStage",
|
||||||
|
"LidarPointField",
|
||||||
|
"LidarPoseStatus",
|
||||||
|
"LidarQualityMonitor",
|
||||||
|
"LidarReadiness",
|
||||||
|
"LidarRepresentation",
|
||||||
|
"LidarStageAssessment",
|
||||||
|
"LidarTimeBasis",
|
||||||
|
"assess_lidar_profile",
|
||||||
|
"lidar_readiness_document",
|
||||||
|
"sensor_frame_xyzi",
|
||||||
|
),
|
||||||
|
".lidar_contract",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"E10_LIDAR_PACK_SCHEMA",
|
||||||
|
"FIELD_REVIEW_ARRAYS_NAME",
|
||||||
|
"FIELD_REVIEW_MANIFEST_NAME",
|
||||||
|
"FIELD_REVIEW_REPORT_NAME",
|
||||||
|
"LIDAR_FIELD_REVIEW_REPORT_SCHEMA",
|
||||||
|
"LIDAR_FIELD_REVIEW_SCHEMA",
|
||||||
|
"LIDAR_FIELD_REVIEW_WINDOW_SCHEMA",
|
||||||
|
"MAX_FIELD_REVIEW_WINDOW_POINTS",
|
||||||
|
"RAVNOVES00_CENTRAL_WINDOWS",
|
||||||
|
"E10LidarFieldSource",
|
||||||
|
"FieldReviewWindowSpec",
|
||||||
|
"LidarFieldReviewV1",
|
||||||
|
"build_lidar_field_review",
|
||||||
|
"lidar_field_review_catalog_item",
|
||||||
|
),
|
||||||
|
".lidar_field_review",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"DEFAULT_GROUND_BENCHMARK_PROFILE",
|
||||||
|
"LIDAR_GROUND_ANNOTATION_TEMPLATE_SCHEMA",
|
||||||
|
"LIDAR_GROUND_BENCHMARK_REPORT_SCHEMA",
|
||||||
|
"LIDAR_GROUND_BENCHMARK_SCHEMA",
|
||||||
|
"LIDAR_GROUND_FRAME_SCHEMA",
|
||||||
|
"PATCHWORKPP_SOURCE_COMMIT",
|
||||||
|
"PATCHWORKPP_SOURCE_TAG",
|
||||||
|
"PATCHWORKPP_SOURCE_URL",
|
||||||
|
"GroundBenchmarkProfile",
|
||||||
|
"GroundSegmentation",
|
||||||
|
"LidarGroundBenchmarkV1",
|
||||||
|
"LidarGroundError",
|
||||||
|
"LocalPercentileGroundSegmenter",
|
||||||
|
"PatchworkPPGroundSegmenter",
|
||||||
|
"build_lidar_ground_annotation_template",
|
||||||
|
"build_lidar_ground_benchmark",
|
||||||
|
"lidar_ground_benchmark_catalog_item",
|
||||||
|
"lidar_ground_frame_detail",
|
||||||
|
"score_ground_labels",
|
||||||
|
),
|
||||||
|
".lidar_ground",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"DEFAULT_K1_LOCAL_SURFACE_PROFILE",
|
||||||
|
"K1_LOCAL_SURFACE_FRAME_SCHEMA",
|
||||||
|
"K1_LOCAL_SURFACE_REPORT_SCHEMA",
|
||||||
|
"K1_LOCAL_SURFACE_REVIEW_SCHEMA",
|
||||||
|
"K1_LOCAL_SURFACE_SCHEMA",
|
||||||
|
"K1_LOCAL_SURFACE_TIMELINE_SCHEMA",
|
||||||
|
"K1LocalSurfaceProfile",
|
||||||
|
"K1LocalSurfaceV1",
|
||||||
|
"build_k1_local_surface",
|
||||||
|
"k1_local_surface_catalog_item",
|
||||||
|
),
|
||||||
|
".lidar_local_surface",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"K1_LOCAL_SURFACE_BINDER_SCHEMA",
|
||||||
|
"K1_LOCAL_SURFACE_SHADOW_FRAME_SCHEMA",
|
||||||
|
"K1_LOCAL_SURFACE_SHADOW_SCHEMA",
|
||||||
|
"K1LocalSurfaceBoundViews",
|
||||||
|
"K1LocalSurfacePoseBinder",
|
||||||
|
"K1LocalSurfaceShadowCoordinator",
|
||||||
|
"K1LocalSurfaceShadowEstimator",
|
||||||
|
"K1LocalSurfaceShadowInput",
|
||||||
|
"K1LocalSurfaceShadowResult",
|
||||||
|
"K1LocalSurfaceShadowRuntime",
|
||||||
|
),
|
||||||
|
".lidar_local_surface_shadow",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"LIDAR_EQUIVALENCE_REPORT_SCHEMA",
|
||||||
|
"LIDAR_QUALITY_REPORT_SCHEMA",
|
||||||
|
"LIDAR_REPLAY_PACK_SCHEMA",
|
||||||
|
"LidarReplayError",
|
||||||
|
"LidarReplayPackV2",
|
||||||
|
"LidarReplayPointFrame",
|
||||||
|
"LidarReplayPoseFrame",
|
||||||
|
"build_lidar_replay_pack_v2",
|
||||||
|
"lidar_pack_catalog_item",
|
||||||
|
"lidar_pack_detail",
|
||||||
|
"verify_lidar_replay_equivalence",
|
||||||
|
),
|
||||||
|
".lidar_replay",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"LIVE_INGRESS_SCHEMA",
|
||||||
|
"LIVE_INGRESS_WIRE_SCHEMA",
|
||||||
|
"TELEMETRY_SCHEMA",
|
||||||
|
"WORLD_STATE_SCHEMA",
|
||||||
|
"LatestWinsQueue",
|
||||||
|
"LiveIngressEvent",
|
||||||
|
"LivePerceptionIngress",
|
||||||
|
"QueueSnapshot",
|
||||||
|
"WorldStateProjector",
|
||||||
|
"classify_health",
|
||||||
|
),
|
||||||
|
".live_perception",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"LiveReplayQualificationResult",
|
||||||
|
"validate_live_replay_qualification_result",
|
||||||
|
),
|
||||||
|
".live_replay_qualification",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"MultiratePerceptionArtifact",
|
||||||
|
"MultiratePerceptionQualificationResult",
|
||||||
|
"validate_multirate_perception_qualification_result",
|
||||||
|
),
|
||||||
|
".multirate_perception_qualification",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"RecordedPerceptionEpochResult",
|
||||||
|
"RecordedPerceptionEpochStore",
|
||||||
|
"RecordedPerceptionVideo",
|
||||||
|
"validate_recorded_perception_epoch_result",
|
||||||
|
),
|
||||||
|
".perception_epoch",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"DEFAULT_QUALIFICATION_FRAME_COUNT",
|
||||||
|
"QUALIFICATION_POLICY",
|
||||||
|
"QualificationFrame",
|
||||||
|
"RecordedQualificationSlice",
|
||||||
|
"RecordedQualificationSliceError",
|
||||||
|
"prepare_recorded_qualification_slice",
|
||||||
|
"validate_recorded_qualification_slice",
|
||||||
|
),
|
||||||
|
".qualification",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"RealtimeTrackingArtifact",
|
||||||
|
"RealtimeTrackingQualificationResult",
|
||||||
|
"validate_realtime_tracking_qualification_result",
|
||||||
|
),
|
||||||
|
".realtime_tracking_qualification",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"DetectionFrame",
|
||||||
|
"ObjectDetection",
|
||||||
|
"RecordedPerceptionOverlayArtifact",
|
||||||
|
"RecordedPerceptionOverlayError",
|
||||||
|
"RecordedPerceptionOverlayStore",
|
||||||
|
"RecordedPerceptionResult",
|
||||||
|
"validate_recorded_perception_result",
|
||||||
|
),
|
||||||
|
".results",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"POINT_SLAB_SCHEMA",
|
||||||
|
"TRACK_GEOMETRY_BINDING_SCHEMA",
|
||||||
|
"TRACK_GEOMETRY_FRAME_SCHEMA",
|
||||||
|
"TRACK_GEOMETRY_SCHEMA",
|
||||||
|
"PointSlab",
|
||||||
|
"TrackGeometry",
|
||||||
|
"TrackGeometryContractError",
|
||||||
|
"TrackGeometryCurrentness",
|
||||||
|
"TrackGeometryEvidenceState",
|
||||||
|
"TrackGeometryFrame",
|
||||||
|
"TrackGeometryMetricBasis",
|
||||||
|
"TrackGeometryOwnerKind",
|
||||||
|
"TrackGeometrySourceBinding",
|
||||||
|
),
|
||||||
|
".track_geometry",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"TrackedFusionQualificationResult",
|
||||||
|
"validate_tracked_fusion_qualification_result",
|
||||||
|
),
|
||||||
|
".tracked_fusion_qualification",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"TrackingQualificationArtifact",
|
||||||
|
"TrackingQualificationResult",
|
||||||
|
"validate_tracking_qualification_result",
|
||||||
|
),
|
||||||
|
".tracking_qualification",
|
||||||
|
),
|
||||||
|
}
|
||||||
|
|
||||||
|
if set(_EXPORTS) != set(__all__) or len(_EXPORTS) != len(__all__):
|
||||||
|
raise RuntimeError("compute lazy export table does not match __all__")
|
||||||
|
|
||||||
|
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
module_name = _EXPORTS.get(name)
|
||||||
|
if module_name is None:
|
||||||
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||||
|
value: Any = getattr(import_module(module_name, __name__), name)
|
||||||
|
globals()[name] = value
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
def __dir__() -> list[str]:
|
||||||
|
return sorted({*globals(), *__all__})
|
||||||
|
|||||||
@@ -1,5 +1,30 @@
|
|||||||
"""XGRIDS/LixelKity K1 compatibility plugin implementation."""
|
"""XGRIDS/LixelKity K1 compatibility plugin implementation."""
|
||||||
|
|
||||||
from .observation import build_xgrids_k1_observation, xgrids_k1_archive_source
|
from importlib import import_module
|
||||||
|
from typing import TYPE_CHECKING, Any, Final
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from .observation import build_xgrids_k1_observation, xgrids_k1_archive_source
|
||||||
|
|
||||||
__all__ = ["build_xgrids_k1_observation", "xgrids_k1_archive_source"]
|
__all__ = ["build_xgrids_k1_observation", "xgrids_k1_archive_source"]
|
||||||
|
|
||||||
|
_EXPORTS: Final = {
|
||||||
|
"build_xgrids_k1_observation": ".observation",
|
||||||
|
"xgrids_k1_archive_source": ".observation",
|
||||||
|
}
|
||||||
|
|
||||||
|
if set(_EXPORTS) != set(__all__) or len(_EXPORTS) != len(__all__):
|
||||||
|
raise RuntimeError("XGRIDS K1 lazy export table does not match __all__")
|
||||||
|
|
||||||
|
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
module_name = _EXPORTS.get(name)
|
||||||
|
if module_name is None:
|
||||||
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||||
|
value: Any = getattr(import_module(module_name, __name__), name)
|
||||||
|
globals()[name] = value
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
def __dir__() -> list[str]:
|
||||||
|
return sorted({*globals(), *__all__})
|
||||||
|
|||||||
@@ -1,33 +1,37 @@
|
|||||||
"""Bounded, offline analysis of sensitive K1 evidence artifacts."""
|
"""Bounded, offline analysis of sensitive K1 evidence artifacts."""
|
||||||
|
|
||||||
from k1link.device_plugins.xgrids_k1.analyze.calibrated_overlay import (
|
from importlib import import_module
|
||||||
CalibratedOverlayExperiment,
|
from typing import TYPE_CHECKING, Any, Final
|
||||||
CalibratedOverlayExperimentError,
|
|
||||||
run_calibrated_overlay_experiment,
|
if TYPE_CHECKING:
|
||||||
)
|
from k1link.device_plugins.xgrids_k1.analyze.calibrated_overlay import (
|
||||||
from k1link.device_plugins.xgrids_k1.analyze.calibrated_projection import (
|
CalibratedOverlayExperiment,
|
||||||
CalibratedProjectionError,
|
CalibratedOverlayExperimentError,
|
||||||
Kb4ProjectionProfile,
|
run_calibrated_overlay_experiment,
|
||||||
ProjectedPointCloud,
|
)
|
||||||
depth_colors,
|
from k1link.device_plugins.xgrids_k1.analyze.calibrated_projection import (
|
||||||
map_points_to_lidar,
|
CalibratedProjectionError,
|
||||||
project_map_points_kb4,
|
Kb4ProjectionProfile,
|
||||||
quaternion_xyzw_to_rotation_matrix,
|
ProjectedPointCloud,
|
||||||
unproject_pixels_kb4,
|
depth_colors,
|
||||||
)
|
map_points_to_lidar,
|
||||||
from k1link.device_plugins.xgrids_k1.analyze.stream_summary import (
|
project_map_points_kb4,
|
||||||
DEFAULT_STREAM_SUMMARY_MAX_PAYLOAD_BYTES,
|
quaternion_xyzw_to_rotation_matrix,
|
||||||
MAX_STREAM_SUMMARY_PAYLOAD_BYTES,
|
unproject_pixels_kb4,
|
||||||
StreamSummary,
|
)
|
||||||
summarize_mqtt_streams,
|
from k1link.device_plugins.xgrids_k1.analyze.stream_summary import (
|
||||||
)
|
DEFAULT_STREAM_SUMMARY_MAX_PAYLOAD_BYTES,
|
||||||
from k1link.device_plugins.xgrids_k1.analyze.valid_fov import (
|
MAX_STREAM_SUMMARY_PAYLOAD_BYTES,
|
||||||
DEFAULT_EDGE_MARGIN_PIXELS,
|
StreamSummary,
|
||||||
K1ValidFovMask,
|
summarize_mqtt_streams,
|
||||||
K1ValidFovMaskError,
|
)
|
||||||
prepare_k1_valid_fov_mask,
|
from k1link.device_plugins.xgrids_k1.analyze.valid_fov import (
|
||||||
validate_k1_valid_fov_mask,
|
DEFAULT_EDGE_MARGIN_PIXELS,
|
||||||
)
|
K1ValidFovMask,
|
||||||
|
K1ValidFovMaskError,
|
||||||
|
prepare_k1_valid_fov_mask,
|
||||||
|
validate_k1_valid_fov_mask,
|
||||||
|
)
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"CalibratedOverlayExperiment",
|
"CalibratedOverlayExperiment",
|
||||||
@@ -51,3 +55,62 @@ __all__ = [
|
|||||||
"unproject_pixels_kb4",
|
"unproject_pixels_kb4",
|
||||||
"validate_k1_valid_fov_mask",
|
"validate_k1_valid_fov_mask",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
_EXPORTS: Final = {
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"CalibratedOverlayExperiment",
|
||||||
|
"CalibratedOverlayExperimentError",
|
||||||
|
"run_calibrated_overlay_experiment",
|
||||||
|
),
|
||||||
|
".calibrated_overlay",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"CalibratedProjectionError",
|
||||||
|
"Kb4ProjectionProfile",
|
||||||
|
"ProjectedPointCloud",
|
||||||
|
"depth_colors",
|
||||||
|
"map_points_to_lidar",
|
||||||
|
"project_map_points_kb4",
|
||||||
|
"quaternion_xyzw_to_rotation_matrix",
|
||||||
|
"unproject_pixels_kb4",
|
||||||
|
),
|
||||||
|
".calibrated_projection",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"DEFAULT_STREAM_SUMMARY_MAX_PAYLOAD_BYTES",
|
||||||
|
"MAX_STREAM_SUMMARY_PAYLOAD_BYTES",
|
||||||
|
"StreamSummary",
|
||||||
|
"summarize_mqtt_streams",
|
||||||
|
),
|
||||||
|
".stream_summary",
|
||||||
|
),
|
||||||
|
**dict.fromkeys(
|
||||||
|
(
|
||||||
|
"DEFAULT_EDGE_MARGIN_PIXELS",
|
||||||
|
"K1ValidFovMask",
|
||||||
|
"K1ValidFovMaskError",
|
||||||
|
"prepare_k1_valid_fov_mask",
|
||||||
|
"validate_k1_valid_fov_mask",
|
||||||
|
),
|
||||||
|
".valid_fov",
|
||||||
|
),
|
||||||
|
}
|
||||||
|
|
||||||
|
if set(_EXPORTS) != set(__all__) or len(_EXPORTS) != len(__all__):
|
||||||
|
raise RuntimeError("XGRIDS K1 analysis lazy export table does not match __all__")
|
||||||
|
|
||||||
|
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
module_name = _EXPORTS.get(name)
|
||||||
|
if module_name is None:
|
||||||
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||||
|
value: Any = getattr(import_module(module_name, __name__), name)
|
||||||
|
globals()[name] = value
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
def __dir__() -> list[str]:
|
||||||
|
return sorted({*globals(), *__all__})
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import textwrap
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
REPOSITORY_ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
SOURCE_ROOT = REPOSITORY_ROOT / "src"
|
||||||
|
|
||||||
|
|
||||||
|
def test_m49_container_import_excludes_optional_visualization_dependencies() -> None:
|
||||||
|
script = textwrap.dedent(
|
||||||
|
"""
|
||||||
|
import hashlib
|
||||||
|
import importlib.abc
|
||||||
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
|
blocked = frozenset({"PIL", "pyarrow", "rerun"})
|
||||||
|
|
||||||
|
class OptionalDependencyBlocker(importlib.abc.MetaPathFinder):
|
||||||
|
def find_spec(self, fullname, path=None, target=None):
|
||||||
|
if fullname.partition(".")[0] in blocked:
|
||||||
|
raise ModuleNotFoundError(
|
||||||
|
f"blocked optional dependency: {fullname}",
|
||||||
|
name=fullname,
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
|
||||||
|
assert blocked.isdisjoint(sys.modules)
|
||||||
|
sys.meta_path.insert(0, OptionalDependencyBlocker())
|
||||||
|
|
||||||
|
import k1link.compute as compute
|
||||||
|
import k1link.device_plugins.xgrids_k1 as xgrids_k1
|
||||||
|
import k1link.device_plugins.xgrids_k1.analyze as analyze
|
||||||
|
import k1link.observatory.m49_worker_container_main as container_main
|
||||||
|
from k1link.compute import LidarReplayPackV2
|
||||||
|
from k1link.compute.lidar_replay import LidarReplayPackV2 as DirectReplayPack
|
||||||
|
from k1link.device_plugins.xgrids_k1.analyze import Kb4ProjectionProfile
|
||||||
|
from k1link.device_plugins.xgrids_k1.analyze.calibrated_projection import (
|
||||||
|
Kb4ProjectionProfile as DirectProjectionProfile,
|
||||||
|
)
|
||||||
|
|
||||||
|
expected_public_api = {
|
||||||
|
compute: (219, "a8616ca1402ee26774fb8c8ca2df12b77877305260bde2d64db75acbdc79b598"),
|
||||||
|
xgrids_k1: (2, "735cce20efdc7b1abd12006073233051c6702b00e8f15d21c2142d671061a79b"),
|
||||||
|
analyze: (20, "4a3edcb6b9c735338c0392838be0eac89cad2db1178a5ab7833c1231b6ecc4c2"),
|
||||||
|
}
|
||||||
|
for package, (length, digest) in expected_public_api.items():
|
||||||
|
payload = json.dumps(package.__all__, separators=(",", ":")).encode()
|
||||||
|
assert len(package.__all__) == length
|
||||||
|
assert hashlib.sha256(payload).hexdigest() == digest
|
||||||
|
assert set(package.__all__).issubset(dir(package))
|
||||||
|
|
||||||
|
assert LidarReplayPackV2 is DirectReplayPack
|
||||||
|
assert Kb4ProjectionProfile is DirectProjectionProfile
|
||||||
|
assert container_main.__name__ == "k1link.observatory.m49_worker_container_main"
|
||||||
|
assert "k1link.compute.fusion_epoch" not in sys.modules
|
||||||
|
assert "k1link.device_plugins.xgrids_k1.observation" not in sys.modules
|
||||||
|
assert (
|
||||||
|
"k1link.device_plugins.xgrids_k1.analyze.calibrated_overlay"
|
||||||
|
not in sys.modules
|
||||||
|
)
|
||||||
|
assert "k1link.device_plugins.xgrids_k1.analyze.valid_fov" not in sys.modules
|
||||||
|
assert all(
|
||||||
|
module.partition(".")[0] not in blocked
|
||||||
|
for module in sys.modules
|
||||||
|
)
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
environment = os.environ.copy()
|
||||||
|
inherited_python_path = environment.get("PYTHONPATH")
|
||||||
|
python_path = [str(SOURCE_ROOT)]
|
||||||
|
if inherited_python_path:
|
||||||
|
python_path.append(inherited_python_path)
|
||||||
|
environment["PYTHONPATH"] = os.pathsep.join(python_path)
|
||||||
|
environment["PYTHONNOUSERSITE"] = "1"
|
||||||
|
|
||||||
|
completed = subprocess.run(
|
||||||
|
[sys.executable, "-c", script],
|
||||||
|
cwd=REPOSITORY_ROOT,
|
||||||
|
env=environment,
|
||||||
|
check=False,
|
||||||
|
capture_output=True,
|
||||||
|
text=True,
|
||||||
|
timeout=30,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert completed.returncode == 0, completed.stderr
|
||||||
Reference in New Issue
Block a user