Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
BaseBlenderAPIClient,
)
from openutm_verification.core.execution.scenario_runner import scenario_step
from openutm_verification.core.flight_phase import FlightPhase
from openutm_verification.simulator.geo_json_telemetry import (
GeoJSONAirtrafficSimulator,
)
Expand All @@ -33,7 +34,7 @@ def __init__(self, settings: AirTrafficSettings):
# but we inherit from it. Ideally, we should refactor to composition over inheritance.
BaseBlenderAPIClient.__init__(self, base_url="", credentials={})

@scenario_step("Fetch Session IDs")
@scenario_step("Fetch Session IDs", phase=FlightPhase.PRE_FLIGHT)
async def get_configured_session_ids(
self,
) -> list[UUID]:
Expand All @@ -54,7 +55,7 @@ async def get_configured_session_ids(
raise
return session_ids

@scenario_step("Generate Simulated Air Traffic Data")
@scenario_step("Generate Simulated Air Traffic Data", phase=FlightPhase.PRE_FLIGHT)
async def generate_simulated_air_traffic_data(
self,
config_path: str | None = None,
Expand Down Expand Up @@ -105,7 +106,7 @@ async def generate_simulated_air_traffic_data(
logger.error(f"Failed to generate telemetry states from {config_path}: {exc}")
raise

@scenario_step("Generate Simulated Air Traffic Data with Latency")
@scenario_step("Generate Simulated Air Traffic Data with Latency", phase=FlightPhase.PRE_FLIGHT)
async def generate_simulated_air_traffic_data_with_latency(
self,
config_path: str | None = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
BaseBlenderAPIClient,
)
from openutm_verification.core.execution.scenario_runner import scenario_step
from openutm_verification.core.flight_phase import FlightPhase
from openutm_verification.simulator.models.flight_data_types import FlightObservationSchema


Expand All @@ -42,7 +43,7 @@ def __init__(self, settings: BayesianAirTrafficSettings):
# but we inherit from it. Ideally, we should refactor to composition over inheritance.
BaseBlenderAPIClient.__init__(self, base_url="", credentials={})

@scenario_step("Fetch Session IDs for Bayesian Simulation")
@scenario_step("Fetch Session IDs for Bayesian Simulation", phase=FlightPhase.PRE_FLIGHT)
async def get_configured_bayesian_session_ids(
self,
) -> list[UUID]:
Expand All @@ -65,7 +66,7 @@ async def get_configured_bayesian_session_ids(
raise
return session_ids

@scenario_step("Generate Bayesian Simulation Air Traffic Data")
@scenario_step("Generate Bayesian Simulation Air Traffic Data", phase=FlightPhase.PRE_FLIGHT)
async def generate_bayesian_sim_air_traffic_data(
self,
config_path: str | None = None,
Expand Down Expand Up @@ -206,7 +207,7 @@ def _convert_track_to_observations(

return observations

@scenario_step("Generate Bayesian Simulation Air Traffic Data with latency issues")
@scenario_step("Generate Bayesian Simulation Air Traffic Data with latency issues", phase=FlightPhase.PRE_FLIGHT)
async def generate_bayesian_sim_air_traffic_data_with_sensor_latency_issues(
self,
config_path: str | None = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
BaseBlenderAPIClient,
)
from openutm_verification.core.execution.scenario_runner import scenario_step
from openutm_verification.core.flight_phase import FlightPhase
from openutm_verification.simulator.models.flight_data_types import (
FlightObservationSchema,
)
Expand All @@ -36,7 +37,7 @@ def __init__(self, settings: BlueSkyAirTrafficSettings):
# but we inherit from it. Ideally, we should refactor to composition over inheritance.
BaseBlenderAPIClient.__init__(self, base_url="", credentials={})

@scenario_step("Generate BlueSky Simulation Air Traffic Data")
@scenario_step("Generate BlueSky Simulation Air Traffic Data", phase=FlightPhase.PRE_FLIGHT)
async def generate_bluesky_sim_air_traffic_data(
self,
config_path: str | None = None,
Expand Down Expand Up @@ -141,7 +142,7 @@ async def generate_bluesky_sim_air_traffic_data(
all_obs.extend(results_by_acid[acid])
return all_obs

@scenario_step("Generate BlueSky Simulation Air Traffic Data with latency issues")
@scenario_step("Generate BlueSky Simulation Air Traffic Data with latency issues", phase=FlightPhase.PRE_FLIGHT)
async def generate_bluesky_sim_air_traffic_data_with_sensor_latency_issues(
self,
config_path: str | None = None,
Expand Down
13 changes: 7 additions & 6 deletions src/openutm_verification/core/clients/amqp/amqp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from pydantic import BaseModel

from openutm_verification.core.execution.scenario_runner import scenario_step
from openutm_verification.core.flight_phase import FlightPhase

if TYPE_CHECKING:
from openutm_verification.core.execution.config_models import AMQPConfig
Expand Down Expand Up @@ -246,7 +247,7 @@ def _consumer_loop(
pass
logger.info("AMQP consumer stopped")

@scenario_step("Start AMQP Queue Monitor")
@scenario_step("Start AMQP Queue Monitor", phase=FlightPhase.PRE_FLIGHT)
async def start_queue_monitor(
self,
queue_name: str | None = None,
Expand Down Expand Up @@ -295,7 +296,7 @@ async def start_queue_monitor(
"duration": duration,
}

@scenario_step("Stop AMQP Queue Monitor")
@scenario_step("Stop AMQP Queue Monitor", phase=FlightPhase.POST_FLIGHT)
async def stop_queue_monitor(self) -> dict[str, Any]:
"""Stop the AMQP queue monitor.

Expand All @@ -321,7 +322,7 @@ async def stop_queue_monitor(self) -> dict[str, Any]:
"error": self._state.error,
}

@scenario_step("Get AMQP Messages")
@scenario_step("Get AMQP Messages", phase=FlightPhase.CRUISE)
async def get_received_messages(
self,
routing_key_filter: str | None = None,
Expand Down Expand Up @@ -353,7 +354,7 @@ async def get_received_messages(

return [m.to_dict() for m in messages]

@scenario_step("Wait for AMQP Messages")
@scenario_step("Wait for AMQP Messages", phase=FlightPhase.CRUISE)
async def wait_for_messages(
self,
count: int = 1,
Expand Down Expand Up @@ -395,7 +396,7 @@ async def wait_for_messages(
"error": f"Timed out waiting for {count} messages, got {len(messages)}",
}

@scenario_step("Clear AMQP Messages")
@scenario_step("Clear AMQP Messages", phase=FlightPhase.POST_FLIGHT)
async def clear_messages(self) -> dict[str, Any]:
"""Clear the collected messages buffer.

Expand All @@ -409,7 +410,7 @@ async def clear_messages(self) -> dict[str, Any]:
logger.info(f"Cleared {count} AMQP messages")
return {"cleared_count": count}

@scenario_step("Check AMQP Connection")
@scenario_step("Check AMQP Connection", phase=FlightPhase.PRE_FLIGHT)
async def check_connection(self) -> dict[str, Any]:
"""Check if AMQP connection can be established.

Expand Down
Loading
Loading