Skip to content

Commit

Permalink
fixes following review
Browse files Browse the repository at this point in the history
  • Loading branch information
mickmis committed Sep 15, 2023
1 parent cbf1ac5 commit ad8a00d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 30 deletions.
21 changes: 8 additions & 13 deletions monitoring/monitorlib/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ class DistanceUnits(str, Enum):


class LatLngPoint(ImplicitDict):
"""Vertex in latitude and longitude"""

lat: float
"""Latitude (degrees)"""

lng: float
"""Longitude (degrees)"""

def as_s2sphere(self) -> s2sphere.LatLng:
return s2sphere.LatLng.from_degrees(self.lat, self.lng)


class Radius(ImplicitDict):
Expand Down Expand Up @@ -251,16 +259,3 @@ def to_vertices(self) -> List[s2sphere.LatLng]:
s2sphere.LatLng.from_degrees(self.lat_max, self.lng_max),
s2sphere.LatLng.from_degrees(self.lat_min, self.lng_max),
]


class LatLngVertex(ImplicitDict):
"""Vertex in latitude and longitude"""

lat: float
"""Latitude (degrees)"""

lng: float
"""Longitude (degrees)"""

def as_s2sphere(self) -> s2sphere.LatLng:
return s2sphere.LatLng.from_degrees(self.lat, self.lng)
6 changes: 3 additions & 3 deletions monitoring/monitorlib/mutate/rid.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,11 @@ def errors(self) -> List[str]:
# The augmented.yaml version of the definition should be fixed and then this can be applied to both version.
if self.rid_version == RIDVersion.f3411_22a:
validation_errors = schema_validation.validate(
self.rid_version.openapi_path,
self.rid_version.openapi_delete_isa_response_path
openapi_path=self.rid_version.openapi_path,
object_path=self.rid_version.openapi_delete_isa_response_path
if self.mutation == "delete"
else self.rid_version.openapi_put_isa_response_path,
self.query.response.json,
instance=self.query.response.json,
)
if validation_errors:
return [
Expand Down
16 changes: 10 additions & 6 deletions monitoring/uss_qualifier/resources/netrid/service_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List

from implicitdict import ImplicitDict, StringBasedDateTime
from monitoring.monitorlib.geo import LatLngVertex
from monitoring.monitorlib.geo import LatLngPoint

from monitoring.uss_qualifier.resources.resource import Resource

Expand All @@ -15,7 +15,7 @@ class ServiceAreaSpecification(ImplicitDict):
This URL will probably not identify a real resource in tests."""

footprint: List[LatLngVertex]
footprint: List[LatLngPoint]
"""2D outline of service area"""

altitude_min: float = 0
Expand All @@ -33,12 +33,16 @@ class ServiceAreaSpecification(ImplicitDict):
time_end: StringBasedDateTime
"""End time of service area (relative to reference_time)"""

def shifted_time_start(self, now: datetime.datetime) -> datetime.datetime:
dt = now - self.reference_time.datetime
def shifted_time_start(
self, new_reference_time: datetime.datetime
) -> datetime.datetime:
dt = new_reference_time - self.reference_time.datetime
return self.time_start.datetime + dt

def shifted_time_end(self, now: datetime.datetime) -> datetime.datetime:
dt = now - self.reference_time.datetime
def shifted_time_end(
self, new_reference_time: datetime.datetime
) -> datetime.datetime:
dt = new_reference_time - self.reference_time.datetime
return self.time_end.datetime + dt


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ When a pre-existing ISA needs to be deleted to ensure a clean workspace, any sub

### [Create ISA test step](test_steps/put_isa.md)

This step attempts to create at the DSS the ISA provided as resource.
This step attempts to query the configured DSS with the ISA provided as a resource.

### Get ISA by ID test step

This step attempts to retrieve at the DSS the ISA just created.
This step attempts to retrieve the previously created ISA from the DSS.

#### Successful ISA query check

Expand All @@ -73,8 +73,8 @@ The cleanup phase of this test scenario attempts to remove the ISA if the test e

### Removed pre-existing ISA check

If an ISA with the intended ID is still present in the DSS, it needs to be removed before exiting the test. If that ISA cannot be deleted, then the **[astm.f3411.v19.DSS0030](../../../../../requirements/astm/f3411/v19.md)** requirement to implement the ISA deletion endpoint might not be met.
If an ISA with the intended ID is still present in the DSS, it needs to be removed before exiting the test. If that ISA cannot be deleted, then the **[astm.f3411.v19.DSS0030](../../../../../requirements/astm/f3411/v19.md)** requirement to implement the ISA deletion endpoint might not be met.

### Notified subscriber check

When an ISA is deleted, subscribers must be notified. If a subscriber cannot be notified, that subscriber USS did not correctly implement "POST Identification Service Area" in **[astm.f3411.v19.NET0730](../../../../../requirements/astm/f3411/v19.md)**.
When an ISA is deleted, subscribers must be notified. If a subscriber cannot be notified, that subscriber USS did not correctly implement "POST Identification Service Area" in **[astm.f3411.v19.NET0730](../../../../../requirements/astm/f3411/v19.md)**.
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ When a pre-existing ISA needs to be deleted to ensure a clean workspace, any sub

### [Create ISA test step](test_steps/put_isa.md)

This step attempts to create at the DSS the ISA provided as resource.
This step attempts to query the configured DSS with the ISA provided as a resource.

### Get ISA by ID test step

This step attempts to retrieve at the DSS the ISA just created.
This step attempts to retrieve the previously created ISA from the DSS.

#### Successful ISA query check

Expand All @@ -73,8 +73,8 @@ The cleanup phase of this test scenario attempts to remove the ISA if the test e

### Removed pre-existing ISA check

If an ISA with the intended ID is still present in the DSS, it needs to be removed before exiting the test. If that ISA cannot be deleted, then the **[astm.f3411.v22a.DSS0030](../../../../../requirements/astm/f3411/v22a.md)** requirement to implement the ISA deletion endpoint might not be met.
If an ISA with the intended ID is still present in the DSS, it needs to be removed before exiting the test. If that ISA cannot be deleted, then the **[astm.f3411.v22a.DSS0030](../../../../../requirements/astm/f3411/v22a.md)** requirement to implement the ISA deletion endpoint might not be met.

### Notified subscriber check

When an ISA is deleted, subscribers must be notified. If a subscriber cannot be notified, that subscriber USS did not correctly implement "POST Identification Service Area" in **[astm.f3411.v22a.NET0730](../../../../../requirements/astm/f3411/v22a.md)**.
When an ISA is deleted, subscribers must be notified. If a subscriber cannot be notified, that subscriber USS did not correctly implement "POST Identification Service Area" in **[astm.f3411.v22a.NET0730](../../../../../requirements/astm/f3411/v22a.md)**.

0 comments on commit ad8a00d

Please sign in to comment.