Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MetObsAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
MetObs
MetObsAPI
Commits
78357b50
Verified
Commit
78357b50
authored
2 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Fix mypy issues
parent
2ff638b5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
metobsapi/server.py
+2
-1
2 additions, 1 deletion
metobsapi/server.py
metobsapi/util/file_responses.py
+14
-3
14 additions, 3 deletions
metobsapi/util/file_responses.py
pyproject.toml
+0
-1
0 additions, 1 deletion
pyproject.toml
setup.cfg
+0
-1
0 additions, 1 deletion
setup.cfg
with
16 additions
and
6 deletions
metobsapi/server.py
+
2
−
1
View file @
78357b50
...
...
@@ -3,7 +3,8 @@ import logging
import
os
from
datetime
import
datetime
from
enum
import
Enum
from
urllib.request
import
URLError
,
urlopen
from
urllib.error
import
URLError
from
urllib.request
import
urlopen
from
flask
import
Flask
,
jsonify
,
render_template
,
request
from
flask_cors
import
CORS
...
...
This diff is collapsed.
Click to expand it.
metobsapi/util/file_responses.py
+
14
−
3
View file @
78357b50
import
os
from
collections
import
defaultdict
from
typing
import
TypedDict
from
metobsapi.util
import
FREQUENCY_DIR_FMT
,
ProductFrequency
...
...
@@ -9,8 +10,19 @@ LA0_DESCRIPTION = "converted to netCDF"
L11_DESCRIPTION
=
"
calibration factors applied and converted to geophysical units
"
LB1_DESCRIPTION
=
"
QC checks applied to measurements
"
class
InstInfo
(
TypedDict
):
display_name
:
str
levels
:
dict
[
str
,
dict
]
class
SiteInfo
(
TypedDict
):
display_name
:
str
instruments
:
dict
[
str
,
InstInfo
]
# TODO: Load from config file
ARCHIVE_INFO
=
{
ARCHIVE_INFO
:
dict
[
str
,
SiteInfo
]
=
{
"
aoss
"
:
{
"
display_name
"
:
"
AOSS
"
,
"
instruments
"
:
{
...
...
@@ -155,7 +167,7 @@ for file_suffix in (
ARCHIVE_INFO
[
"
aoss
"
][
"
instruments
"
][
"
aeri
"
][
"
levels
"
][
"
level_00
"
][
"
products
"
][
product_id
]
=
nfo
# Create stream_id -> stream_info mapping
ARCHIVE_STREAMS
=
{}
ARCHIVE_STREAMS
:
dict
[
str
,
dict
|
list
[
str
]]
=
{}
# Also create <site>.<inst> -> [stream_id, ...]
INSTRUMENT_STREAMS
=
defaultdict
(
list
)
stream_id_fmt
=
"
{site}.{inst}.{product}.{level}.{version}
"
...
...
@@ -163,7 +175,6 @@ for site, site_info in ARCHIVE_INFO.items():
for
inst
,
inst_info
in
site_info
[
"
instruments
"
].
items
():
inst_name
=
site
+
"
.
"
+
inst
for
level
,
level_info
in
inst_info
[
"
levels
"
].
items
():
all_products_recent
=
[]
for
version
in
level_info
[
"
versions
"
]:
all_products
=
[]
for
product_id
,
pattern_info
in
level_info
[
"
products
"
].
items
():
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
0
−
1
View file @
78357b50
...
...
@@ -65,4 +65,3 @@ tests = [
[tool.setuptools]
packages
=
[
"metobsapi"
]
This diff is collapsed.
Click to expand it.
setup.cfg
+
0
−
1
View file @
78357b50
...
...
@@ -6,4 +6,3 @@ ignore = D101,D102,D103,D104,D106,D107,W503,E203,B008
relative_files
=
True
omit
=
metobsapi/version.py
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