Skip to content

Commit

Permalink
Changed to oneline imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Teddy-1000 committed Jan 22, 2024
1 parent 3e1b111 commit 9606d1b
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 245 deletions.
6 changes: 4 additions & 2 deletions api/dependencies.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from datetime import datetime, timedelta
from datetime import datetime
from datetime import timedelta
from typing import Tuple

from google.protobuf.timestamp_pb2 import Timestamp
from pydantic import AwareDatetime, TypeAdapter
from pydantic import AwareDatetime
from pydantic import TypeAdapter


def get_datetime_range(datetime_string: str | None) -> Tuple[Timestamp, Timestamp] | None:
Expand Down
3 changes: 2 additions & 1 deletion api/formatters/base_formatter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from abc import ABC, abstractmethod
from abc import ABC
from abc import abstractmethod


class EDR_formatter(ABC):
Expand Down
12 changes: 8 additions & 4 deletions api/formatters/covjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
from datetime import timezone
from itertools import groupby

from covjson_pydantic.coverage import Coverage, CoverageCollection
from covjson_pydantic.domain import Axes, Domain, DomainType, ValuesAxis
from covjson_pydantic.coverage import Coverage
from covjson_pydantic.coverage import CoverageCollection
from covjson_pydantic.domain import Axes
from covjson_pydantic.domain import Domain
from covjson_pydantic.domain import DomainType
from covjson_pydantic.domain import ValuesAxis
from covjson_pydantic.ndarray import NdArray
from covjson_pydantic.observed_property import ObservedProperty
from covjson_pydantic.parameter import Parameter
from covjson_pydantic.reference_system import (ReferenceSystem,
ReferenceSystemConnectionObject)
from covjson_pydantic.reference_system import ReferenceSystem
from covjson_pydantic.reference_system import ReferenceSystemConnectionObject
from covjson_pydantic.unit import Unit
from formatters.base_formatter import EDR_formatter
from pydantic import AwareDatetime
Expand Down
3 changes: 2 additions & 1 deletion api/locustfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import random

from locust import HttpUser, task
from locust import HttpUser
from locust import task

parameters = ["ff", "dd", "rh", "pp", "tn"]
# fmt: off
Expand Down
6 changes: 4 additions & 2 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import metadata_endpoints
from brotli_asgi import BrotliMiddleware
from edr_pydantic.capabilities import LandingPageModel
from edr_pydantic.collections import Collection, Collections
from fastapi import FastAPI, Request
from edr_pydantic.collections import Collection
from edr_pydantic.collections import Collections
from fastapi import FastAPI
from fastapi import Request
from routers import edr # , records

logger = logging.getLogger(__name__)
Expand Down
16 changes: 11 additions & 5 deletions api/metadata_endpoints.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
from edr_pydantic.capabilities import Contact, LandingPageModel, Provider
from edr_pydantic.collections import Collection, Collections
from edr_pydantic.data_queries import DataQueries, EDRQuery
from edr_pydantic.extent import Extent, Spatial
from edr_pydantic.link import EDRQueryLink, Link
from edr_pydantic.capabilities import Contact
from edr_pydantic.capabilities import LandingPageModel
from edr_pydantic.capabilities import Provider
from edr_pydantic.collections import Collection
from edr_pydantic.collections import Collections
from edr_pydantic.data_queries import DataQueries
from edr_pydantic.data_queries import EDRQuery
from edr_pydantic.extent import Extent
from edr_pydantic.extent import Spatial
from edr_pydantic.link import EDRQueryLink
from edr_pydantic.link import Link
from edr_pydantic.variables import Variables


Expand Down
15 changes: 11 additions & 4 deletions api/routers/edr.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# For developing: uvicorn main:app --reload
import datastore_pb2 as dstore
import formatters
from covjson_pydantic.coverage import Coverage, CoverageCollection
from covjson_pydantic.coverage import Coverage
from covjson_pydantic.coverage import CoverageCollection
from dependencies import get_datetime_range
from fastapi import APIRouter, Path, Query
from geojson_pydantic import Feature, FeatureCollection, Point
from fastapi import APIRouter
from fastapi import Path
from fastapi import Query
from geojson_pydantic import Feature
from geojson_pydantic import FeatureCollection
from geojson_pydantic import Point
from grpc_getter import getObsRequest
from shapely import buffer, geometry, wkt
from shapely import buffer
from shapely import geometry
from shapely import wkt

router = APIRouter(prefix="/collections/observations")

Expand Down
54 changes: 0 additions & 54 deletions ingest/src/esoh/datastore_pb2.py

This file was deleted.

162 changes: 0 additions & 162 deletions ingest/src/esoh/datastore_pb2_grpc.py

This file was deleted.

3 changes: 2 additions & 1 deletion ingest/src/esoh/ingest/bufr/bufrprint.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
import sys

from bufresohmsg_py import bufrprint_py, init_bufrtables_py
from bufresohmsg_py import bufrprint_py
from bufresohmsg_py import init_bufrtables_py


def bufrprint(bufr_file: str) -> str:
Expand Down
9 changes: 6 additions & 3 deletions ingest/src/esoh/ingest/bufr/create_mqtt_message_from_bufr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
import os
import sys

from esoh.ingest.bufr.bufresohmsg_py import (bufresohmsg_py, bufrlog_clear_py,
bufrlog_py, init_bufr_schema_py,
init_bufrtables_py, init_oscar_py)
from esoh.ingest.bufr.bufresohmsg_py import bufresohmsg_py
from esoh.ingest.bufr.bufresohmsg_py import bufrlog_clear_py
from esoh.ingest.bufr.bufresohmsg_py import bufrlog_py
from esoh.ingest.bufr.bufresohmsg_py import init_bufr_schema_py
from esoh.ingest.bufr.bufresohmsg_py import init_bufrtables_py
from esoh.ingest.bufr.bufresohmsg_py import init_oscar_py


def build_all_json_payloads_from_bufr(bufr_file_path: str) -> list[str]:
Expand Down
10 changes: 6 additions & 4 deletions ingest/src/esoh/ingest/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
from datetime import datetime, timezone

import xarray as xr
from esoh.ingest.bufr.create_mqtt_message_from_bufr import \
build_all_json_payloads_from_bufr
from esoh.ingest.netCDF.extract_metadata_netcdf import \
build_all_json_payloads_from_netcdf
from esoh.ingest.bufr.create_mqtt_message_from_bufr import (
build_all_json_payloads_from_bufr,
)
from esoh.ingest.netCDF.extract_metadata_netcdf import (
build_all_json_payloads_from_netcdf,
)
from jsonschema import ValidationError

logger = logging.getLogger(__name__)
Expand Down
7 changes: 5 additions & 2 deletions ingest/test/test_verify_json_payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

import pytest
import xarray as xr
from esoh.ingest.bufr.bufresohmsg_py import (init_bufr_schema_py,
init_bufrtables_py, init_oscar_py)
from esoh.ingest.bufr.bufresohmsg_py import (
init_bufr_schema_py,
init_bufrtables_py,
init_oscar_py,
)
from esoh.ingest.main import IngestToPipeline
from jsonschema import Draft202012Validator, ValidationError

Expand Down

0 comments on commit 9606d1b

Please sign in to comment.