Skip to content

Save scenario related generated data in reports. - #72

Merged
RomanPszonka merged 9 commits into
openutm:mainfrom
atti92:saved-generated-data
Dec 15, 2025
Merged

Save scenario related generated data in reports.#72
RomanPszonka merged 9 commits into
openutm:mainfrom
atti92:saved-generated-data

Conversation

@atti92

@atti92 atti92 commented Dec 13, 2025

Copy link
Copy Markdown
Contributor

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"

image

Closes #51

@atti92
atti92 marked this pull request as ready for review December 13, 2025 22:31
@RomanPszonka

Copy link
Copy Markdown
Contributor

each run should have timestamped subfolder for all reports of that run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_data function to save flight declaration, telemetry, and air traffic data as JSON files in scenario subdirectories
  • Refactors observation data handling from dictionaries to FlightObservationSchema objects throughout the codebase
  • Updates type annotations to use more specific types (FlightDeclaration, list[RIDAircraftState], list[FlightObservationSchema]) and modern Python syntax (str | None instead of Optional[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 (capitalized List, Dict). For consistency and since Python 3.12 is the minimum version (which supports PEP 585), consider using lowercase list and dict consistently 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.

Comment thread src/openutm_verification/core/execution/scenario_runner.py Outdated
Comment thread src/openutm_verification/core/reporting/reporting_models.py Outdated
@atti92

atti92 commented Dec 14, 2025

Copy link
Copy Markdown
Contributor Author

@RomanPszonka

each run should have timestamped subfolder for all reports of that run

Implemented

@RomanPszonka
RomanPszonka merged commit e731b7f into openutm:main Dec 15, 2025
2 checks passed
atti92 added a commit that referenced this pull request Dec 30, 2025
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logging and reporting: Save generated datasets

3 participants