Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Geomagnetism Program
geomag-algorithms
Commits
d3c78148
Commit
d3c78148
authored
4 years ago
by
Jeremy M Fee
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Pipfile
+1
-1
1 addition, 1 deletion
Pipfile
Pipfile.lock
+6
-6
6 additions, 6 deletions
Pipfile.lock
geomagio/api/ws/Observatory.py
+16
-4
16 additions, 4 deletions
geomagio/api/ws/Observatory.py
with
23 additions
and
11 deletions
Pipfile
+
1
−
1
View file @
d3c78148
...
...
@@ -20,7 +20,7 @@ authlib = "*"
cryptography
=
"*"
databases
=
{
extras
=
[
"postgresql"
,
"sqlite"],version
=
"*"
}
fastapi
=
"*"
httpx
=
"=
=
0.1
2
.
1
"
httpx
=
"=
=
0.1
1
.
1
"
openpyxl
=
"*"
orm
=
"=
=
0.1
.
5
"
pydantic = "
=
=
1.4
"
...
...
This diff is collapsed.
Click to expand it.
Pipfile.lock
+
6
−
6
View file @
d3c78148
{
"_meta"
:
{
"hash"
:
{
"sha256"
:
"
0080c46fcd35a3d58478fb313c8c91b5c2f52f155c3da9fe2ea7bfdc0a06d109
"
"sha256"
:
"
9d11130b39f605d10cd4d32c8b721e21b38cdbae4b5eaf19f794d6181184a08c
"
},
"pipfile-spec"
:
6
,
"requires"
:
{},
...
...
@@ -226,11 +226,11 @@
},
"httpx"
:
{
"hashes"
:
[
"sha256:
405b4749f597b1f45cae5bffc17b23dc251cce30a0c4c8126f1007b9e728a615
"
,
"sha256:
ce51c8e8ed2834447fde5a94650299fd74017b7
da
6
9c
c786b6421fefda09a393
"
"sha256:
1d3893d3e4244c569764a6bae5c5a9fbbc4a6ec3825450b5696602af7a275576
"
,
"sha256:
7d2bfb726eeed717953d15dddb22
da9c
2fcf48a4d70ba1456aa0a7faeda33cf7
"
],
"index"
:
"pypi"
,
"version"
:
"==0.1
2
.1"
"version"
:
"==0.1
1
.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"
:
[
...
...
This diff is collapsed.
Click to expand it.
geomagio/api/ws/Observatory.py
+
16
−
4
View file @
d3c78148
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment