Skip to content

Commit

Permalink
Apply pre-commit hook.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey-Vervoort-KNMI committed Feb 28, 2024
1 parent b501126 commit 4822fe6
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
3 changes: 1 addition & 2 deletions api/metadata_endpoints.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from datetime import datetime
from typing import Dict

from formatters.covjson import make_parameter
import datastore_pb2 as dstore
from edr_pydantic.capabilities import Contact
from edr_pydantic.capabilities import LandingPageModel
Expand All @@ -15,7 +14,7 @@
from edr_pydantic.link import EDRQueryLink
from edr_pydantic.link import Link
from edr_pydantic.observed_property import ObservedProperty
from edr_pydantic.parameter import Parameter, Parameters
from edr_pydantic.parameter import Parameter
from edr_pydantic.unit import Unit
from edr_pydantic.variables import Variables
from fastapi import HTTPException
Expand Down
4 changes: 1 addition & 3 deletions api/routers/edr.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# For developing: uvicorn main:app --reload
from collections import defaultdict
from datetime import datetime
from typing import Annotated
from typing import DefaultDict
from typing import Dict
Expand All @@ -21,7 +20,6 @@
from formatters.covjson import make_parameter
from geojson_pydantic import Feature
from geojson_pydantic import Point
from google.protobuf.timestamp_pb2 import Timestamp
from grpc_getter import get_obs_request
from shapely import buffer
from shapely import geometry
Expand Down Expand Up @@ -51,7 +49,7 @@ async def get_locations(
spatial_area=dstore.Polygon(
points=[dstore.Point(lat=coord[1], lon=coord[0]) for coord in poly.exterior.coords],
),
temporal_mode="latest"
temporal_mode="latest",
)

ts_response = await get_obs_request(ts_request)
Expand Down
5 changes: 4 additions & 1 deletion datastore/data-loader/client_knmi_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
from google.protobuf.timestamp_pb2 import Timestamp
from parameters import knmi_parameter_names

regex_level = re.compile(r"first|second|third|grass|[0-9]+(\.[0-9]+)?(?=m)|(Level )[0-9]+|(?<=\()[ A-z]+(?=\))", re.IGNORECASE)
regex_level = re.compile(
r"first|second|third|grass|[0-9]+(\.[0-9]+)?(?=m)|(Level )[0-9]+|(?<=\()[ A-z]+(?=\))", re.IGNORECASE
)


def netcdf_file_to_requests(file_path: Path | str) -> Tuple[List, List]:
observation_request_messages = []
Expand Down
8 changes: 6 additions & 2 deletions datastore/examples/clients/python/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def dtime2tstamp(dtime):


# callPutObs demonstrates how to insert observations in the datastore.
def call_put_obs(stub, version, type, standard_name, unit, value, title, instrument, level, function, period, parameter_name):
def call_put_obs(
stub, version, type, standard_name, unit, value, title, instrument, level, function, period, parameter_name
):
ts_mdata = dstore.TSMetadata(
version=version,
type=type,
Expand Down Expand Up @@ -105,7 +107,9 @@ def call_get_obs_in_polygon(stub):
period = "PT0S"
parameter_name = "_".join([standard_name, level, function, period])

response = call_put_obs(stub, version, type, standard_name, unit, value, title, instrument, level, function, period, parameter_name)
response = call_put_obs(
stub, version, type, standard_name, unit, value, title, instrument, level, function, period, parameter_name
)
print("response from call_put_obs: {}".format(response))

response = call_get_obs_in_time_range(stub)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -538,4 +538,4 @@
}
}
}
}
}

1 comment on commit 4822fe6

@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%24–69
datastore_pb2_grpc.py432347%37–52, 85–87, 92–94, 99–101, 106–108, 112–136, 174, 191, 208, 225
dependencies.py481862%16, 26–27, 34, 41, 52, 62–69, 77–84
grpc_getter.py16850%15–16, 20–23, 27–29
locustfile.py15150%1–31
main.py22386%27, 37, 47
metadata_endpoints.py361267%26, 44–105, 109
custom_geo_json
   edr_feature_collection.py60100% 
formatters
   \_\_init\_\_.py70100% 
   covjson.py51688%72, 79–83, 87–90
routers
   \_\_init\_\_.py00100% 
   edr.py883758%45–104, 132–144, 173, 184–190, 229–246
   records.py00100% 
TOTAL39016857% 

API Unit Test Coverage Summary

Tests Skipped Failures Errors Time
16 0 💤 9 ❌ 0 🔥 2.379s ⏱️

Please sign in to comment.