Skip to content
Snippets Groups Projects
Commit 93a7050c authored by Geels, Brendan Ryan's avatar Geels, Brendan Ryan :tophat:
Browse files

Black re-reformatting

parent 4b20d7ff
No related branches found
No related tags found
1 merge request!312Update black and gunicorn
Showing
with 33 additions and 13 deletions
"""Module for bin
"""
from __future__ import absolute_import
from . import geomag
......
......@@ -16,7 +16,6 @@ Notes: We use numpy functions instead of standard python arithmetic funtions
functions.
"""
import numpy
......
"""Abstract Timeseries Factory Interface."""
from __future__ import absolute_import
from obspy.core import Stream
......
......@@ -6,6 +6,7 @@ Geo: Based on Geographic North. X, Y, Z, F
Obs: Based on the observatories orientaion. H, E, Z, F, d0
Mag: Based on Magnetic North. H, D, Z, F
"""
from __future__ import absolute_import
import numpy
......
"""Stream wrapper for TimeseriesFactory."""
from __future__ import absolute_import
from .TimeseriesFactory import TimeseriesFactory
......
"""Abstract Timeseries Factory Interface."""
from __future__ import absolute_import, print_function
from io import BytesIO
import os
......
"""Timeseries Utilities"""
from builtins import range
from datetime import datetime
import math
......@@ -443,9 +444,11 @@ def unmask_stream(stream):
unmasked = Stream()
for trace in stream:
unmasked += Trace(
trace.data.filled(fill_value=numpy.nan)
if isinstance(trace.data, numpy.ma.MaskedArray)
else trace.data,
(
trace.data.filled(fill_value=numpy.nan)
if isinstance(trace.data, numpy.ma.MaskedArray)
else trace.data
),
trace.stats,
)
return unmasked
......
"""Algorithm that creates an averaged Dst.
"""
from __future__ import absolute_import
from .Algorithm import Algorithm
......
"""Algorithm that creates a deltaf
"""
from __future__ import absolute_import
from .Algorithm import Algorithm
......
......@@ -11,6 +11,7 @@
Use of fmin_l_bfgs_b to estimate parameters inspired by Andre Queiroz:
https://gist.github.com/andrequeiroz/5888967
"""
from __future__ import absolute_import, print_function
from .. import StreamConverter
......
......@@ -2,6 +2,7 @@
related coordinate system.
"""
from __future__ import absolute_import
from .Algorithm import Algorithm
......
"""
Geomag Algorithms module
"""
from __future__ import absolute_import
# base classes
......
......@@ -6,6 +6,7 @@ and can be run using uvicorn, or any other ASGI server:
uvicorn geomagio.api:app
"""
import logging
import os
......
"""Module with application for "/ws/secure" endpoints.
"""
from .app import app
__all__ = ["app"]
......@@ -33,6 +33,7 @@ Usage:
/logout - logout current user
/user - access current user information as json
"""
import logging
import os
from typing import Callable, List, Optional
......
......@@ -13,6 +13,7 @@ Configuration:
ADMIN_GROUP - delete is restricted the admin group.
REVIEWER_GROUP - update is restricted the reviewer group.
"""
import os
from typing import List
......
......@@ -73,12 +73,14 @@ class Observatory(BaseModel):
"sensor_sampling_rate": 0.01,
"declination_base": self.declination_base,
},
"geometry": {
"type": "Point",
"coordinates": [self.longitude, self.latitude, self.elevation],
}
if self.name != "USGS"
else None, # no geojson for USGS(virtual observatory)
"geometry": (
{
"type": "Point",
"coordinates": [self.longitude, self.latitude, self.elevation],
}
if self.name != "USGS"
else None
), # no geojson for USGS(virtual observatory)
}
......
"""Module with application for "/ws" endpoints.
"""
from .app import app
__all__ = ["app"]
......@@ -45,9 +45,9 @@ if METADATA_ENDPOINT:
@app.middleware("http")
async def add_headers(request: Request, call_next):
response = await call_next(request)
response.headers[
"Access-Control-Allow-Headers"
] = "accept, origin, authorization, content-type"
response.headers["Access-Control-Allow-Headers"] = (
"accept, origin, authorization, content-type"
)
response.headers["Access-Control-Allow-Methods"] = "*"
response.headers["Access-Control-Allow-Origin"] = "*"
response.headers["Cache-Control"] = "max-age=60"
......
"""Factory that creates BinLog Files."""
from __future__ import absolute_import
from ..TimeseriesFactory import TimeseriesFactory
......
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