Skip to content

Commit

Permalink
[uss_qualifier] make start/end time optional parameters of make_volum…
Browse files Browse the repository at this point in the history
…e_4d and its callers
  • Loading branch information
Shastick committed Nov 1, 2023
1 parent 89aaa4b commit 4729305
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 15 deletions.
4 changes: 2 additions & 2 deletions monitoring/monitorlib/mutate/rid.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def upsert_subscription(
area_vertices: List[s2sphere.LatLng],
alt_lo: float,
alt_hi: float,
start_time: datetime.datetime,
end_time: datetime.datetime,
start_time: Optional[datetime.datetime],
end_time: Optional[datetime.datetime],
uss_base_url: str,
subscription_id: str,
rid_version: RIDVersion,
Expand Down
16 changes: 12 additions & 4 deletions monitoring/monitorlib/rid_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def make_volume_4d(
vertices: List[s2sphere.LatLng],
alt_lo: float,
alt_hi: float,
start_time: datetime.datetime,
end_time: datetime.datetime,
start_time: Optional[datetime.datetime],
end_time: Optional[datetime.datetime],
) -> Volume4D:
return ImplicitDict.parse(
{
Expand All @@ -38,8 +38,16 @@ def make_volume_4d(
"altitude_lo": alt_lo,
"altitude_hi": alt_hi,
},
"time_start": StringBasedDateTime(start_time),
"time_end": StringBasedDateTime(end_time),
**(
{"time_start": StringBasedDateTime(start_time)}
if start_time is not None
else {}
),
**(
{"time_end": StringBasedDateTime(end_time)}
if end_time is not None
else {}
),
},
Volume4D,
)
Expand Down
18 changes: 13 additions & 5 deletions monitoring/monitorlib/rid_v2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import datetime
from typing import List
from typing import List, Optional

import s2sphere
from implicitdict import ImplicitDict, StringBasedDateTime
Expand Down Expand Up @@ -33,8 +33,8 @@ def make_volume_4d(
vertices: List[s2sphere.LatLng],
alt_lo: float,
alt_hi: float,
start_time: datetime.datetime,
end_time: datetime.datetime,
start_time: Optional[datetime.datetime],
end_time: Optional[datetime.datetime],
) -> Volume4D:
return ImplicitDict.parse(
{
Expand All @@ -48,8 +48,16 @@ def make_volume_4d(
"altitude_lower": make_altitude(alt_lo),
"altitude_upper": make_altitude(alt_hi),
},
"time_start": make_time(start_time),
"time_end": make_time(end_time),
**(
{"time_start": StringBasedDateTime(start_time)}
if start_time is not None
else {}
),
**(
{"time_end": StringBasedDateTime(end_time)}
if end_time is not None
else {}
),
},
Volume4D,
)
Expand Down
8 changes: 4 additions & 4 deletions monitoring/uss_qualifier/scenarios/astm/netrid/dss_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,8 @@ def put_sub_expect_response_code(
area_vertices: List[s2sphere.LatLng],
alt_lo: float,
alt_hi: float,
start_time: datetime.datetime,
end_time: datetime.datetime,
start_time: Optional[datetime.datetime],
end_time: Optional[datetime.datetime],
expected_error_codes: Set[int],
uss_base_url: str,
sub_id: str,
Expand Down Expand Up @@ -823,8 +823,8 @@ def put_sub(
area_vertices: List[s2sphere.LatLng],
alt_lo: float,
alt_hi: float,
start_time: datetime.datetime,
end_time: datetime.datetime,
start_time: Optional[datetime.datetime],
end_time: Optional[datetime.datetime],
uss_base_url: str,
sub_id: str,
sub_version: Optional[str] = None,
Expand Down

0 comments on commit 4729305

Please sign in to comment.