Skip to content
Snippets Groups Projects
Commit d3c78148 authored by Jeremy M Fee's avatar Jeremy M Fee
Browse files

Revert httpx dependency version, add lat/lon validator for observatory and fix values

parent 11b38a27
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ authlib = "*"
cryptography = "*"
databases = {extras = ["postgresql", "sqlite"],version = "*"}
fastapi = "*"
httpx = "==0.12.1"
httpx = "==0.11.1"
openpyxl = "*"
orm = "==0.1.5"
pydantic = "==1.4"
......
{
"_meta": {
"hash": {
"sha256": "0080c46fcd35a3d58478fb313c8c91b5c2f52f155c3da9fe2ea7bfdc0a06d109"
"sha256": "9d11130b39f605d10cd4d32c8b721e21b38cdbae4b5eaf19f794d6181184a08c"
},
"pipfile-spec": 6,
"requires": {},
......@@ -226,11 +226,11 @@
},
"httpx": {
"hashes": [
"sha256:405b4749f597b1f45cae5bffc17b23dc251cce30a0c4c8126f1007b9e728a615",
"sha256:ce51c8e8ed2834447fde5a94650299fd74017b7da69cc786b6421fefda09a393"
"sha256:1d3893d3e4244c569764a6bae5c5a9fbbc4a6ec3825450b5696602af7a275576",
"sha256:7d2bfb726eeed717953d15dddb22da9c2fcf48a4d70ba1456aa0a7faeda33cf7"
],
"index": "pypi",
"version": "==0.12.1"
"version": "==0.11.1"
},
"hyperframe": {
"hashes": [
......@@ -378,10 +378,10 @@
},
"orm": {
"hashes": [
"sha256:e415e8ad6e638ab902a562a7bf03a190c20faf38d6e8f64d86cefcc4d56e309d"
"sha256:37cb4757b670c1713f4e0d65874c5afe819acbd712abb9743c97e1d4b00d511c"
],
"index": "pypi",
"version": "==0.2.0.dev0"
"version": "==0.1.5"
},
"psycopg2-binary": {
"hashes": [
......
......@@ -29,6 +29,18 @@ class Observatory(BaseModel):
agency_name = "Japan Meteorological Agency (JMA)"
return agency_name
@validator("latitude")
def validate_latitude(cls, latitude: float) -> float:
if latitude > 90 or latitude < -90:
raise ValueError(f"latitude ({latitude}) out of range [-90, 90]")
return latitude
@validator("longitude")
def validate_longitude(cls, longitude: float) -> float:
if longitude > 360 or longitude < -360:
raise ValueError(f"longitude ({longitude}) out of range [-360, 360]")
return longitude
@validator("sensor_orientation", always=True)
def validate_sensor_orientation(cls, sensor_orientation: str, values: Dict) -> str:
agency = values.get("agency")
......@@ -71,8 +83,8 @@ OBSERVATORIES = [
Observatory(
id="BRW",
elevation=10,
latitude=203.378,
longitude=71.322,
latitude=71.322,
longitude=203.378,
name="Barrow",
agency="USGS",
declination_base=10589,
......@@ -80,8 +92,8 @@ OBSERVATORIES = [
Observatory(
id="BRT",
elevation=10,
latitude=203.378,
longitude=71.322,
latitude=71.322,
longitude=203.378,
name="Barrow Test (ObsRIO)",
agency="USGS",
declination_base=10589,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment