Save scenario related generated data in reports. - #72
Conversation
|
each run should have timestamped subfolder for all reports of that run |
There was a problem hiding this comment.
Pull request overview
This PR enhances the reporting system by creating scenario-specific subdirectories and saving generated data (flight declarations, telemetry, and air traffic) in JSON format within those directories. It also improves type safety by replacing dictionary-based observation data with proper Pydantic schema objects (FlightObservationSchema).
Key changes:
- Introduces
_save_scenario_datafunction to save flight declaration, telemetry, and air traffic data as JSON files in scenario subdirectories - Refactors observation data handling from dictionaries to
FlightObservationSchemaobjects throughout the codebase - Updates type annotations to use more specific types (
FlightDeclaration,list[RIDAircraftState],list[FlightObservationSchema]) and modern Python syntax (str | Noneinstead ofOptional[str])
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/openutm_verification/core/reporting/reporting.py |
Adds _save_scenario_data function to save generated data as JSON; updates visualization paths to use scenario subdirectories |
src/openutm_verification/core/reporting/reporting_models.py |
Updates ScenarioResult model with specific types for flight declaration, telemetry, and air traffic data; adds arbitrary_types_allowed configuration |
src/openutm_verification/core/execution/scenario_runner.py |
Adds air_traffic_data tracking to ScenarioState and ScenarioContext; updates type annotations for flight declaration and telemetry data |
src/openutm_verification/core/clients/flight_blender/flight_blender_client.py |
Updates air traffic submission methods to use FlightObservationSchema instead of dictionaries; adds air traffic data tracking |
src/openutm_verification/core/clients/opensky/opensky_client.py |
Changes return type from list[dict] to list[FlightObservationSchema] for observation processing |
src/openutm_verification/core/clients/air_traffic/air_traffic_client.py |
Updates return type annotation for simulated air traffic data generation |
src/openutm_verification/simulator/geo_json_telemetry.py |
Changes generate_air_traffic_data to return FlightObservationSchema objects instead of dictionaries |
src/openutm_verification/scenarios/common.py |
Updates return type annotations for generate_flight_declaration and generate_telemetry functions |
src/openutm_verification/scenarios/registry.py |
Adds air traffic data extraction and passing to scenario results |
tests/test_client_steps.py |
Updates test data from dictionaries to FlightObservationSchema objects; updates assertion from dict access to object attribute access |
config/pull_request.yaml |
Reorders scenarios to run add_flight_declaration first |
Comments suppressed due to low confidence (2)
src/openutm_verification/core/reporting/reporting_models.py:76
- Inconsistent use of type annotations: the file mixes PEP 585 style (lowercase
list,dict) with typing module style (capitalizedList,Dict). For consistency and since Python 3.12 is the minimum version (which supports PEP 585), consider using lowercaselistanddictconsistently throughout the file.
steps: list[StepResult[Any]]
error_message: str | None = None
flight_declaration_filename: str | None = None
telemetry_filename: str | None = None
flight_declaration_data: FlightDeclaration | None = None
telemetry_data: list[RIDAircraftState] | None = None
air_traffic_data: list[list[FlightObservationSchema]] | None = None
visualization_2d_path: str | None = None
visualization_3d_path: str | None = None
docs: str | None = None
class ReportSummary(BaseModel):
"""Summary of the entire verification run."""
total_scenarios: int
passed: int
failed: int
class ReportData(BaseModel):
"""Root model for the final report data."""
run_id: str
tool_version: str
start_time_utc: str
end_time_utc: str
total_duration_seconds: float
overall_status: Status
flight_blender_url: str
deployment_details: DeploymentDetails
config_file: str
config: Dict[str, Any]
results: List[ScenarioResult]
src/openutm_verification/core/execution/scenario_runner.py:7
- Import of 'Dict' is not used.
from typing import Any, Awaitable, Callable, Coroutine, Dict, List, Optional, ParamSpec, Protocol, TypedDict, TypeVar, cast, overload
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Implemented |
* Save scenario related generated data in reports. * typing * Save air traffic data * change reporting * fix * reduce report files if empty. * Fix serialization * Change timestamped files to directories. * typing
Create scenario subdirectories for reporting, and also save telemetry and flight declaration in json format there.
Each run creates a directory based on the current date-time: eg "run_2025-12-14T13-02-03Z"
Closes #51