Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uss_qualifier] Make start/end time optional parameters of make_volume_4d #304

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
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 {}
),
**(
Copy link
Member

Choose a reason for hiding this comment

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

I didn't know you could put multiple kwargs as arguments -- nice :)

{"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
Loading