Skip to content

Commit

Permalink
Merge remote-tracking branch 'interuss/main' into clean-up-data-valid…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
BenjaminPelletier committed Dec 19, 2023
2 parents 4f1aa98 + 93023ff commit c1146ad
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 49 deletions.
23 changes: 13 additions & 10 deletions monitoring/monitorlib/clients/flight_planning/client_v1.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import uuid
from typing import Optional

from implicitdict import ImplicitDict
from uas_standards.interuss.automated_testing.flight_planning.v1 import api
from uas_standards.interuss.automated_testing.flight_planning.v1.constants import Scope

from monitoring.monitorlib.clients.flight_planning.client import (
FlightPlannerClient,
)
from monitoring.monitorlib.clients.flight_planning.test_preparation import (
TestPreparationActivityResponse,
)
from monitoring.monitorlib.clients.flight_planning.client import PlanningActivityError
from monitoring.monitorlib.clients.flight_planning.flight_info import (
FlightInfo,
FlightID,
Expand All @@ -15,17 +17,17 @@
from monitoring.monitorlib.clients.flight_planning.planning import (
PlanningActivityResponse,
)
from monitoring.monitorlib.fetch import query_and_describe, QueryType
from monitoring.monitorlib.geotemporal import Volume4D
from monitoring.monitorlib.infrastructure import UTMClientSession
from monitoring.uss_qualifier.configurations.configuration import ParticipantID
from monitoring.monitorlib.clients.flight_planning.client import PlanningActivityError
from monitoring.monitorlib.clients.flight_planning.planning import (
PlanningActivityResult,
FlightPlanStatus,
)
from uas_standards.interuss.automated_testing.flight_planning.v1 import api
from uas_standards.interuss.automated_testing.flight_planning.v1.constants import Scope
from monitoring.monitorlib.clients.flight_planning.test_preparation import (
TestPreparationActivityResponse,
)
from monitoring.monitorlib.fetch import query_and_describe, QueryType
from monitoring.monitorlib.geotemporal import Volume4D
from monitoring.monitorlib.infrastructure import UTMClientSession
from monitoring.uss_qualifier.configurations.configuration import ParticipantID


class V1FlightPlannerClient(FlightPlannerClient):
Expand Down Expand Up @@ -91,6 +93,7 @@ def _inject(
queries=[query],
activity_result=resp.planning_result,
flight_plan_status=resp.flight_plan_status,
includes_advisories=resp.includes_advisories,
)

return response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from monitoring.monitorlib.clients.flight_planning.planning import (
PlanningActivityResult,
FlightPlanStatus,
AdvisoryInclusion,
)
from monitoring.monitorlib.fetch import QueryError, Query
from monitoring.monitorlib.geotemporal import Volume4D, Volume4DCollection
Expand Down Expand Up @@ -122,7 +123,7 @@ def request_flight(
self,
request: InjectFlightRequest,
flight_id: Optional[str] = None,
) -> Tuple[InjectFlightResponse, fetch.Query, str]:
) -> Tuple[InjectFlightResponse, fetch.Query, str, Optional[AdvisoryInclusion]]:
usage_states = {
OperationalIntentState.Accepted: AirspaceUsageState.Planned,
OperationalIntentState.Activated: AirspaceUsageState.InUse,
Expand Down Expand Up @@ -210,7 +211,7 @@ def request_flight(
operational_intent_id="<not provided>",
)

return response, resp.queries[0], flight_id
return response, resp.queries[0], flight_id, resp.includes_advisories

def cleanup_flight(
self, flight_id: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def _validate_ended_cancellation(self):
self._intents_extent,
) as planned_validator:
self.begin_test_step("Plan flight intent")
_, flight_id = plan_flight_intent(
_, flight_id, _ = plan_flight_intent(
self,
self.tested_uss,
self.valid_flight.request,
Expand All @@ -212,7 +212,7 @@ def _validate_ended_cancellation(self):

def _validate_precision_intersection(self):
self.begin_test_step("Plan control flight intent")
_, _ = plan_flight_intent(
_, _, _ = plan_flight_intent(
self,
self.tested_uss,
self.valid_flight.request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def _attempt_plan_flight_conflict(self) -> OperationalIntentReference:
self._intents_extent,
) as validator:
self.begin_test_step("Plan Flight 2")
_, self.flight2_id = plan_flight_intent(
_, self.flight2_id, _ = plan_flight_intent(
self,
self.control_uss,
self.flight2_planned.request,
Expand Down Expand Up @@ -287,7 +287,7 @@ def _attempt_modify_planned_flight_conflict(
self._intents_extent,
) as validator:
self.begin_test_step("Plan Flight 1c")
_, self.flight1_id = plan_flight_intent(
_, self.flight1_id, _ = plan_flight_intent(
self,
self.tested_uss,
self.flight1c_planned.request,
Expand Down Expand Up @@ -393,7 +393,7 @@ def _modify_activated_flight_preexisting_conflict(
self._intents_extent,
) as validator:
self.begin_test_step("Plan Flight 2m")
_, self.flight2_id = plan_flight_intent(
_, self.flight2_id, _ = plan_flight_intent(
self,
self.control_uss,
self.flight2m_planned.request,
Expand All @@ -410,7 +410,7 @@ def _modify_activated_flight_preexisting_conflict(
flight_2_oi_ref,
) as validator:
self.begin_test_step("Declare Flight 2 non-conforming")
resp_flight_2, _ = submit_flight_intent(
resp_flight_2, _, _ = submit_flight_intent(
self,
"Successful transition to non-conforming state",
{
Expand Down Expand Up @@ -442,7 +442,7 @@ def _modify_activated_flight_preexisting_conflict(
self.begin_test_step(
"Attempt to modify activated Flight 1 in conflict with nonconforming Flight 2"
)
resp_flight_1, _ = submit_flight_intent(
resp_flight_1, _, _ = submit_flight_intent(
self,
"Successful modification or rejection",
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def _attempt_plan_flight_conflict(self):
self._intents_extent,
) as validator:
self.begin_test_step("Plan Flight 2")
resp_flight_2, self.flight2_id = plan_flight_intent(
resp_flight_2, self.flight2_id, _ = plan_flight_intent(
self,
self.control_uss,
self.flight2_planned.request,
Expand Down Expand Up @@ -255,7 +255,7 @@ def _attempt_modify_planned_flight_conflict(
self._intents_extent,
) as validator:
self.begin_test_step("Plan Flight 1")
resp_flight_1, self.flight1_id = plan_flight_intent(
resp_flight_1, self.flight1_id, _ = plan_flight_intent(
self,
self.tested_uss,
self.flight1_planned.request,
Expand All @@ -271,7 +271,7 @@ def _attempt_modify_planned_flight_conflict(
self._intents_extent,
) as validator:
self.begin_test_step("Plan Flight 2")
resp_flight_2, self.flight2_id = plan_flight_intent(
resp_flight_2, self.flight2_id, _ = plan_flight_intent(
self,
self.control_uss,
self.flight2_planned.request,
Expand Down Expand Up @@ -359,7 +359,7 @@ def _modify_activated_flight_conflict_preexisting(
self._intents_extent,
) as validator:
self.begin_test_step("Plan Flight 2")
_, self.flight2_id = plan_flight_intent(
_, self.flight2_id, _ = plan_flight_intent(
self,
self.control_uss,
self.flight2_planned.request,
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _plan_flight_conflict_planned(self):
self._intents_extent,
) as validator:
self.begin_test_step("Tested USS attempts to plan Flight 1")
resp, flight_id = submit_flight_intent(
resp, flight_id, _ = submit_flight_intent(
self,
"Successful planning",
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def plan_priority_conflict_flight_intent(
"""
expect_flight_intent_state(flight_intent, OperationalIntentState.Accepted, scenario)

resp, _ = submit_flight_intent(
resp, _, _ = submit_flight_intent(
scenario,
"Incorrectly planned",
{
Expand Down Expand Up @@ -61,7 +61,7 @@ def modify_planned_priority_conflict_flight_intent(
"""
expect_flight_intent_state(flight_intent, OperationalIntentState.Accepted, scenario)

resp, _ = submit_flight_intent(
resp, _, _ = submit_flight_intent(
scenario,
"Incorrectly modified",
{
Expand Down Expand Up @@ -94,7 +94,7 @@ def activate_priority_conflict_flight_intent(
flight_intent, OperationalIntentState.Activated, scenario
)

resp, _ = submit_flight_intent(
resp, _, _ = submit_flight_intent(
scenario,
"Incorrectly activated",
{
Expand Down Expand Up @@ -127,7 +127,7 @@ def modify_activated_priority_conflict_flight_intent(
flight_intent, OperationalIntentState.Activated, scenario
)

resp, _ = submit_flight_intent(
resp, _, _ = submit_flight_intent(
scenario,
"Incorrectly modified",
{
Expand Down Expand Up @@ -157,7 +157,7 @@ def plan_conflict_flight_intent(
"""
expect_flight_intent_state(flight_intent, OperationalIntentState.Accepted, scenario)

resp, _ = submit_flight_intent(
resp, _, _ = submit_flight_intent(
scenario,
"Incorrectly planned",
{
Expand Down Expand Up @@ -187,7 +187,7 @@ def modify_planned_conflict_flight_intent(
"""
expect_flight_intent_state(flight_intent, OperationalIntentState.Accepted, scenario)

resp, _ = submit_flight_intent(
resp, _, _ = submit_flight_intent(
scenario,
"Incorrectly modified",
{
Expand Down Expand Up @@ -220,7 +220,7 @@ def activate_conflict_flight_intent(
flight_intent, OperationalIntentState.Activated, scenario
)

resp, _ = submit_flight_intent(
resp, _, _ = submit_flight_intent(
scenario,
"Incorrectly activated",
{
Expand Down Expand Up @@ -253,7 +253,7 @@ def modify_activated_conflict_flight_intent(
flight_intent, OperationalIntentState.Activated, scenario
)

resp, _ = submit_flight_intent(
resp, _, _ = submit_flight_intent(
scenario,
"Incorrectly modified",
{
Expand Down Expand Up @@ -287,7 +287,7 @@ def plan_permitted_conflict_flight_intent(
"""
expect_flight_intent_state(flight_intent, OperationalIntentState.Accepted, scenario)

resp, flight_id = submit_flight_intent(
resp, flight_id, _ = submit_flight_intent(
scenario,
"Successful planning",
{InjectFlightResponseResult.Planned},
Expand Down Expand Up @@ -316,7 +316,7 @@ def modify_planned_permitted_conflict_flight_intent(
"""
expect_flight_intent_state(flight_intent, OperationalIntentState.Accepted, scenario)

resp, _ = submit_flight_intent(
resp, _, _ = submit_flight_intent(
scenario,
"Successful modification",
{InjectFlightResponseResult.Planned},
Expand Down Expand Up @@ -348,7 +348,7 @@ def activate_permitted_conflict_flight_intent(
flight_intent, OperationalIntentState.Activated, scenario
)

resp, _ = submit_flight_intent(
resp, _, _ = submit_flight_intent(
scenario,
"Successful activation",
{InjectFlightResponseResult.ReadyToFly},
Expand Down Expand Up @@ -380,7 +380,7 @@ def modify_activated_permitted_conflict_flight_intent(
flight_intent, OperationalIntentState.Activated, scenario
)

resp, _ = submit_flight_intent(
resp, _, _ = submit_flight_intent(
scenario,
"Successful modification",
{InjectFlightResponseResult.ReadyToFly},
Expand Down
Loading

0 comments on commit c1146ad

Please sign in to comment.