Skip to content
Snippets Groups Projects
Verified Commit 78357b50 authored by David Hoese's avatar David Hoese
Browse files

Fix mypy issues

parent 2ff638b5
Branches
No related tags found
No related merge requests found
......@@ -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
......
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():
......
......@@ -65,4 +65,3 @@ tests = [
[tool.setuptools]
packages = ["metobsapi"]
......@@ -6,4 +6,3 @@ ignore = D101,D102,D103,D104,D106,D107,W503,E203,B008
relative_files = True
omit =
metobsapi/version.py
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment