Skip to content

Commit

Permalink
Update grpc function to new format
Browse files Browse the repository at this point in the history
  • Loading branch information
Teddy-1000 committed Feb 6, 2024
1 parent 00f099c commit 3b29f78
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions api/routers/edr.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,12 @@ async def get_data_location_id(
get_obs_request = dstore.GetObsRequest(
filter=dict(
platform=dstore.Strings(values=[location_id]),
instrument=dstore.Strings(values=list(map(str.strip, parameter_name.split(",")))),
standard_name=dstore.Strings(values=[standard_name]),
level=dstore.String(values=[level]),
func=dstore.String(values=[func]),
period=dstore.Strings(values=[period])
),
interval=dstore.TimeInterval(start=range[0], end=range[1]) if range else None,
standard_name=standard_name,
level=level,
func=func,
period=period
)
response = await getObsRequest(get_obs_request)
return edr_formatter[f].convert(response)
Expand Down Expand Up @@ -121,7 +120,12 @@ async def get_data_area(
range = get_datetime_range(datetime)
standard_name, level, func, period = parse_parameter_name(parameter_name)
get_obs_request = dstore.GetObsRequest(
filter=dict(instrument=dstore.Strings(values=list(map(str.strip, parameter_name.split(","))))),
filter=dict(
standard_name=dstore.Strings(values=[standard_name]),
level=dstore.String(values=[level]),
func=dstore.String(values=[func]),
period=dstore.Strings(values=[period])
),
inside=dstore.Polygon(points=[dstore.Point(lat=coord[1], lon=coord[0]) for coord in poly.exterior.coords]),
interval=dstore.TimeInterval(start=range[0], end=range[1]) if range else None,
)
Expand Down

1 comment on commit 3b29f78

@github-actions
Copy link

Choose a reason for hiding this comment

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

API Unit Test Coverage Report
FileStmtsMissCoverMissing
\_\_init\_\_.py00100% 
datastore_pb2.py584621%23–68
datastore_pb2_grpc.py43430%2–225
dependencies.py72703%3–113
grpc_getter.py13130%1–23
locustfile.py15150%1–31
main.py22220%3–51
metadata_endpoints.py19190%1–70
formatters
   \_\_init\_\_.py12650%16–32
   base_formatter.py7186%18
   covjson.py522944%32–33, 37–87, 92–101
routers
   \_\_init\_\_.py00100% 
   edr.py51510%2–134
   records.py00100% 
test
   test_covjson.py604623%13–38, 42–64, 68–89, 93–102, 106–108, 112–113
   test_parse_parameter_name.py28267%4–51
TOTAL45238714% 

API Unit Test Coverage Summary

Tests Skipped Failures Errors Time
1 0 💤 0 ❌ 1 🔥 0.937s ⏱️

Please sign in to comment.