diff --git a/bin/__init__.py b/bin/__init__.py index ef7e90169311f54c153d71afe5c359dddec2d4f8..0db276a14a80711ddadb4bcc3ab70e8635a73094 100644 --- a/bin/__init__.py +++ b/bin/__init__.py @@ -1,5 +1,6 @@ """Module for bin """ + from __future__ import absolute_import from . import geomag diff --git a/geomagio/ChannelConverter.py b/geomagio/ChannelConverter.py index a7c3bfc8b255f77521bce41916ab0b7484a02693..0ca91bfd78beb05a16961d14257bf61f349d1473 100644 --- a/geomagio/ChannelConverter.py +++ b/geomagio/ChannelConverter.py @@ -16,7 +16,6 @@ Notes: We use numpy functions instead of standard python arithmetic funtions functions. """ - import numpy diff --git a/geomagio/PlotTimeseriesFactory.py b/geomagio/PlotTimeseriesFactory.py index 7cfa3677b9ce7740031ebdf63da687e2e698b34b..112b11502b7448b624d464a5dfd6c4dac531067e 100644 --- a/geomagio/PlotTimeseriesFactory.py +++ b/geomagio/PlotTimeseriesFactory.py @@ -1,4 +1,5 @@ """Abstract Timeseries Factory Interface.""" + from __future__ import absolute_import from obspy.core import Stream diff --git a/geomagio/StreamConverter.py b/geomagio/StreamConverter.py index 4ef3232c5db1ef5b0ec7cf4eb62357a9d5550413..79ec46cf04ef9a6a3221a51b4f8d5e1c06c538dc 100644 --- a/geomagio/StreamConverter.py +++ b/geomagio/StreamConverter.py @@ -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 diff --git a/geomagio/StreamTimeseriesFactory.py b/geomagio/StreamTimeseriesFactory.py index 32837aca5c083431318df3630cfb837a8a6481e3..bd95992eac1d3f2ae5633d3a1a93764fbccb77a2 100644 --- a/geomagio/StreamTimeseriesFactory.py +++ b/geomagio/StreamTimeseriesFactory.py @@ -1,4 +1,5 @@ """Stream wrapper for TimeseriesFactory.""" + from __future__ import absolute_import from .TimeseriesFactory import TimeseriesFactory diff --git a/geomagio/TimeseriesFactory.py b/geomagio/TimeseriesFactory.py index 06b32c0b8738f983cfff289c63c25d2f99816138..e2315d29e6309f927ef2c16dd7a88ab0dcbb9644 100644 --- a/geomagio/TimeseriesFactory.py +++ b/geomagio/TimeseriesFactory.py @@ -1,4 +1,5 @@ """Abstract Timeseries Factory Interface.""" + from __future__ import absolute_import, print_function from io import BytesIO import os diff --git a/geomagio/TimeseriesUtility.py b/geomagio/TimeseriesUtility.py index f22ba28d915774c0b61e404bf6d7e73592247531..9550187c29eaea8239a5daa775a220c642bf20ba 100644 --- a/geomagio/TimeseriesUtility.py +++ b/geomagio/TimeseriesUtility.py @@ -1,4 +1,5 @@ """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 diff --git a/geomagio/algorithm/AverageAlgorithm.py b/geomagio/algorithm/AverageAlgorithm.py index 70588de81d5f687118d1b0a9db9558afe931b6d9..9d867aff45d0ba0c2364bb9250dbd12ecbf55bac 100644 --- a/geomagio/algorithm/AverageAlgorithm.py +++ b/geomagio/algorithm/AverageAlgorithm.py @@ -1,6 +1,7 @@ """Algorithm that creates an averaged Dst. """ + from __future__ import absolute_import from .Algorithm import Algorithm diff --git a/geomagio/algorithm/DeltaFAlgorithm.py b/geomagio/algorithm/DeltaFAlgorithm.py index 22ebab00988a260a6fc986048ef076caa5b2ad2a..a89a99774182615ab0f1e6fde1ffbda3797079fd 100644 --- a/geomagio/algorithm/DeltaFAlgorithm.py +++ b/geomagio/algorithm/DeltaFAlgorithm.py @@ -1,6 +1,7 @@ """Algorithm that creates a deltaf """ + from __future__ import absolute_import from .Algorithm import Algorithm diff --git a/geomagio/algorithm/SqDistAlgorithm.py b/geomagio/algorithm/SqDistAlgorithm.py index e2106c0fa1b83f92307b10f47ed3b311adca3ea8..246baa05d87aaf12d2e99fe347f8ccdb3e4d3124 100644 --- a/geomagio/algorithm/SqDistAlgorithm.py +++ b/geomagio/algorithm/SqDistAlgorithm.py @@ -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 diff --git a/geomagio/algorithm/XYZAlgorithm.py b/geomagio/algorithm/XYZAlgorithm.py index 1f43c87853c8da21d7a4636ad1bf7560f35e5471..6ca008f4e43ed19a9787fc088060d43d03aff0f4 100644 --- a/geomagio/algorithm/XYZAlgorithm.py +++ b/geomagio/algorithm/XYZAlgorithm.py @@ -2,6 +2,7 @@ related coordinate system. """ + from __future__ import absolute_import from .Algorithm import Algorithm diff --git a/geomagio/algorithm/__init__.py b/geomagio/algorithm/__init__.py index 1008dceab09372ffdeca472fc17316ca50a9101f..0d56bbcdd630f13aa06df62b94497594cbb3f159 100644 --- a/geomagio/algorithm/__init__.py +++ b/geomagio/algorithm/__init__.py @@ -1,6 +1,7 @@ """ Geomag Algorithms module """ + from __future__ import absolute_import # base classes diff --git a/geomagio/api/app.py b/geomagio/api/app.py index 618fe8edd91d924a8a9d864cc569fba8a5065cf9..6cf83e96b3c6c65f909760d73a1892155f45bcee 100644 --- a/geomagio/api/app.py +++ b/geomagio/api/app.py @@ -6,6 +6,7 @@ and can be run using uvicorn, or any other ASGI server: uvicorn geomagio.api:app """ + import logging import os diff --git a/geomagio/api/secure/__init__.py b/geomagio/api/secure/__init__.py index 2c745c5c16a686bae548edd004bf48ff4e4d1d33..6684194cefef11ec9bea87f6f72ab6b92e4bce2d 100644 --- a/geomagio/api/secure/__init__.py +++ b/geomagio/api/secure/__init__.py @@ -1,5 +1,6 @@ """Module with application for "/ws/secure" endpoints. """ + from .app import app __all__ = ["app"] diff --git a/geomagio/api/secure/login.py b/geomagio/api/secure/login.py index ecd0c7ab85416b730900f8023213de8ca76b4a16..f89da89c6ef84f076466eea847decee60ecf0fd1 100644 --- a/geomagio/api/secure/login.py +++ b/geomagio/api/secure/login.py @@ -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 diff --git a/geomagio/api/secure/metadata.py b/geomagio/api/secure/metadata.py index e5acb0849bc3f08cb00b3e6a8ed092adcfd4b6bd..fb0f8b6e2ec2eb6faeb74e3f81e70d6eb9eab1b1 100644 --- a/geomagio/api/secure/metadata.py +++ b/geomagio/api/secure/metadata.py @@ -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 diff --git a/geomagio/api/ws/Observatory.py b/geomagio/api/ws/Observatory.py index d45c2aff55e540df869ae7211c2a79a6606d0bd7..85df1e58653fc5ed3327586a9bc0cde217ccb491 100644 --- a/geomagio/api/ws/Observatory.py +++ b/geomagio/api/ws/Observatory.py @@ -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) } diff --git a/geomagio/api/ws/__init__.py b/geomagio/api/ws/__init__.py index 125ea3af757d7e39fd138a2609550d9809cb5a91..cd87bf0b86e36cdc340c2f81f47a61e217966af5 100644 --- a/geomagio/api/ws/__init__.py +++ b/geomagio/api/ws/__init__.py @@ -1,5 +1,6 @@ """Module with application for "/ws" endpoints. """ + from .app import app __all__ = ["app"] diff --git a/geomagio/api/ws/app.py b/geomagio/api/ws/app.py index 71f02b194fb1383266bf9e8a864a585e9eff6938..4f3612c922f1cb9b7c8efaa51ab0f7aa0212c812 100644 --- a/geomagio/api/ws/app.py +++ b/geomagio/api/ws/app.py @@ -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" diff --git a/geomagio/binlog/BinLogFactory.py b/geomagio/binlog/BinLogFactory.py index dbe5b882f6736a3795664d64128bf048654b4230..74d48f38200134852dc4482013f42a0ec6f1528c 100644 --- a/geomagio/binlog/BinLogFactory.py +++ b/geomagio/binlog/BinLogFactory.py @@ -1,4 +1,5 @@ """Factory that creates BinLog Files.""" + from __future__ import absolute_import from ..TimeseriesFactory import TimeseriesFactory diff --git a/geomagio/binlog/StreamBinLogFactory.py b/geomagio/binlog/StreamBinLogFactory.py index c7c723b405fbc481e2b1d61b47a43d69b7f4e7c6..590488568d3c8386ab1ca19f421ad4076c986e87 100644 --- a/geomagio/binlog/StreamBinLogFactory.py +++ b/geomagio/binlog/StreamBinLogFactory.py @@ -1,4 +1,5 @@ """Factory to load BinLog files from an input StreamBinLogFactory.""" + from __future__ import absolute_import from .BinLogFactory import BinLogFactory diff --git a/geomagio/binlog/__init__.py b/geomagio/binlog/__init__.py index 5fd9eb78cd3e5292f34319d420812be853709c86..5928f63f9c89336564b18342e10e1a3ce477644b 100644 --- a/geomagio/binlog/__init__.py +++ b/geomagio/binlog/__init__.py @@ -1,5 +1,6 @@ """IO Module for BinLog Format """ + from __future__ import absolute_import from .BinLogFactory import BinLogFactory diff --git a/geomagio/biq/BIQFactory.py b/geomagio/biq/BIQFactory.py index 59d0117a4b84110c5d8d4ad6239f994bb4e1095b..33e76997d5cce630cf07c7359617990e2af2fad6 100644 --- a/geomagio/biq/BIQFactory.py +++ b/geomagio/biq/BIQFactory.py @@ -1,4 +1,5 @@ """Factory that parses BIQ files into arrays and/or ObsPy Stream.""" + import numpy as np import obspy diff --git a/geomagio/edge/EdgeFactory.py b/geomagio/edge/EdgeFactory.py index 70d97eea95d6c9cdcd1e94eab3889267a0b2b005..f46119396e5e6948a4de2612fe55c1d60f79bb3f 100644 --- a/geomagio/edge/EdgeFactory.py +++ b/geomagio/edge/EdgeFactory.py @@ -8,6 +8,7 @@ to take advantage of it's newer realtime abilities. Edge is the USGS earthquake hazard centers replacement for earthworm. """ + from __future__ import absolute_import from datetime import datetime import sys diff --git a/geomagio/edge/MiniSeedFactory.py b/geomagio/edge/MiniSeedFactory.py index 1c898c637bb4ecd32078f90460e09ad5272e7c73..5de50c1ab52ce5920152a9d8e9283e69a912fa8f 100644 --- a/geomagio/edge/MiniSeedFactory.py +++ b/geomagio/edge/MiniSeedFactory.py @@ -8,6 +8,7 @@ to take advantage of it's newer realtime abilities. Edge is the USGS earthquake hazard centers replacement for earthworm. """ + from __future__ import absolute_import import sys from typing import List, Optional diff --git a/geomagio/edge/RawInputClient.py b/geomagio/edge/RawInputClient.py index e6483c7fa5859990f23cbbf84811a937b172ef76..55eae89c95affb323dad9951a32e7c128401b26d 100644 --- a/geomagio/edge/RawInputClient.py +++ b/geomagio/edge/RawInputClient.py @@ -42,7 +42,6 @@ FORCEOUT = -2 class RawInputClient: - """RawInputClient for direct to edge data. Parameters ---------- diff --git a/geomagio/edge/__init__.py b/geomagio/edge/__init__.py index de13ae4079216e0e70a5e777c95ed1d7c5b0473a..e8a4117e3743f8d424246750a2f1f84eeeb41aba 100644 --- a/geomagio/edge/__init__.py +++ b/geomagio/edge/__init__.py @@ -1,5 +1,6 @@ """IO Module for Edge Format """ + from __future__ import absolute_import from .EdgeFactory import EdgeFactory diff --git a/geomagio/iaga2002/IAGA2002Factory.py b/geomagio/iaga2002/IAGA2002Factory.py index a03b8bcba5a0dc4a79ccf54f4abc34f9cc4ec27d..d58e0625c9293a1928114745f19b72d55117bf29 100644 --- a/geomagio/iaga2002/IAGA2002Factory.py +++ b/geomagio/iaga2002/IAGA2002Factory.py @@ -1,4 +1,5 @@ """Factory that loads IAGA2002 Files.""" + from __future__ import absolute_import import obspy.core diff --git a/geomagio/iaga2002/IAGA2002Parser.py b/geomagio/iaga2002/IAGA2002Parser.py index efbfdc3c8b774b2478edcd673ca623753cbe631e..7e861157f1cafcfc98ae4274329e0eaca71efdf7 100644 --- a/geomagio/iaga2002/IAGA2002Parser.py +++ b/geomagio/iaga2002/IAGA2002Parser.py @@ -1,6 +1,5 @@ """Parsing methods for the IAGA2002 Format.""" - import numpy from datetime import datetime diff --git a/geomagio/iaga2002/StreamIAGA2002Factory.py b/geomagio/iaga2002/StreamIAGA2002Factory.py index eb1625f62c57b309c0f5063e520cb09a437b44d6..73f3d58f02e5025a7dea8be5b57c6024262c1e8b 100644 --- a/geomagio/iaga2002/StreamIAGA2002Factory.py +++ b/geomagio/iaga2002/StreamIAGA2002Factory.py @@ -1,4 +1,5 @@ """Factory to load IAGA2002 files from an input StreamIAGA2002Factory.""" + from __future__ import absolute_import from .IAGA2002Factory import IAGA2002Factory diff --git a/geomagio/iaga2002/__init__.py b/geomagio/iaga2002/__init__.py index 66644b4512b06eeffabbc49240f00b1f55d98b69..0a9617effa3de9b4fac7a0bdf81db913f1b26bc8 100644 --- a/geomagio/iaga2002/__init__.py +++ b/geomagio/iaga2002/__init__.py @@ -3,6 +3,7 @@ Based on documentation at: https://www.ngdc.noaa.gov/IAGA/vdat/IAGA2002/iaga2002format.html """ + from __future__ import absolute_import from .IAGA2002Factory import IAGA2002Factory diff --git a/geomagio/imfjson/IMFJSONFactory.py b/geomagio/imfjson/IMFJSONFactory.py index c50dea1c2dfe8132c77b91ecf54fe762fd9562f8..048647ccf39c3a1522c81861ba2cfd7f44c19fa2 100644 --- a/geomagio/imfjson/IMFJSONFactory.py +++ b/geomagio/imfjson/IMFJSONFactory.py @@ -1,4 +1,5 @@ """Factory for json files.""" + from __future__ import absolute_import from ..TimeseriesFactory import TimeseriesFactory diff --git a/geomagio/imfjson/__init__.py b/geomagio/imfjson/__init__.py index 3125b4e8e7ef2c49931f251fcb190c665c448d6d..8cec78d55922a7234c9180ebba7913d6986e300d 100644 --- a/geomagio/imfjson/__init__.py +++ b/geomagio/imfjson/__init__.py @@ -1,5 +1,6 @@ """IO Module for IMFSONFactory Format """ + from __future__ import absolute_import from .IMFJSONFactory import IMFJSONFactory diff --git a/geomagio/imfv122/IMFV122Factory.py b/geomagio/imfv122/IMFV122Factory.py index dfdf0c48c086dca36c99633c5b428c52777d5881..e66f95e1ef4616a9f49a3f4915fd0a0a480dbd94 100644 --- a/geomagio/imfv122/IMFV122Factory.py +++ b/geomagio/imfv122/IMFV122Factory.py @@ -1,4 +1,5 @@ """Factory that loads IMFV122 Files.""" + from __future__ import absolute_import import obspy.core diff --git a/geomagio/imfv122/IMFV122Parser.py b/geomagio/imfv122/IMFV122Parser.py index 1e4959414ef69ec36e588818125468a97743b1e5..09df4262dbe03cc1f98196b17b1fe89371a289da 100644 --- a/geomagio/imfv122/IMFV122Parser.py +++ b/geomagio/imfv122/IMFV122Parser.py @@ -1,6 +1,5 @@ """Parsing methods for the IMFV122 Format.""" - import numpy from obspy.core import UTCDateTime diff --git a/geomagio/imfv122/StreamIMFV122Factory.py b/geomagio/imfv122/StreamIMFV122Factory.py index 4a9575fc9dba04c986b54e76014477c0e6a0c7ad..a50cb332d3f7dc9be82db20f56d18b71a4b35a0a 100644 --- a/geomagio/imfv122/StreamIMFV122Factory.py +++ b/geomagio/imfv122/StreamIMFV122Factory.py @@ -1,4 +1,5 @@ """Factory to load IMFV122 files from an input stream.""" + from __future__ import absolute_import from .IMFV122Factory import IMFV122Factory diff --git a/geomagio/imfv122/__init__.py b/geomagio/imfv122/__init__.py index 8044f6a7b15ae3e292ac89fb13e49d2cc2f64214..dc6129d4f7ebc04018e77e57f264882b85db4a3c 100644 --- a/geomagio/imfv122/__init__.py +++ b/geomagio/imfv122/__init__.py @@ -3,6 +3,7 @@ Based on documentation at: http://www.intermagnet.org/data-donnee/formats/imfv122-eng.php """ + from __future__ import absolute_import from .IMFV122Factory import IMFV122Factory diff --git a/geomagio/imfv283/GOESIMFV283Factory.py b/geomagio/imfv283/GOESIMFV283Factory.py index 195e8710505ea21bd631ec8fdacbb252dfd63947..6c35be4da4369c264767fd31f5425d08e5a43a2f 100644 --- a/geomagio/imfv283/GOESIMFV283Factory.py +++ b/geomagio/imfv283/GOESIMFV283Factory.py @@ -1,4 +1,5 @@ """Factory to load IMFV283 files from an input StreamIMFV283Factory.""" + from __future__ import absolute_import, print_function, unicode_literals from .IMFV283Factory import IMFV283Factory diff --git a/geomagio/imfv283/IMFV283Factory.py b/geomagio/imfv283/IMFV283Factory.py index f2c9d2effb77bfe4b00cc459d55004e43f42364a..9f6b2f4ea09bf554d3679801ec65917280ba8d99 100644 --- a/geomagio/imfv283/IMFV283Factory.py +++ b/geomagio/imfv283/IMFV283Factory.py @@ -1,4 +1,5 @@ """Factory that loads IAGA2002 Files.""" + from __future__ import absolute_import import numpy diff --git a/geomagio/imfv283/IMFV283Parser.py b/geomagio/imfv283/IMFV283Parser.py index b9ae702709bd703a8ce0d56aa39ab964161b7f8e..cf1b03215ecae9c5befd5bdea1aa23533813bc65 100644 --- a/geomagio/imfv283/IMFV283Parser.py +++ b/geomagio/imfv283/IMFV283Parser.py @@ -1,4 +1,5 @@ """Parsing methods for the IMFV283 Format.""" + from __future__ import absolute_import, unicode_literals from builtins import range, str diff --git a/geomagio/imfv283/StreamIMFV283Factory.py b/geomagio/imfv283/StreamIMFV283Factory.py index 402f0e2c3199ceb58ddcb9223815e045f582edf8..905b3ab89dbc73f15b36e0b897a3ac8b4ca214d1 100644 --- a/geomagio/imfv283/StreamIMFV283Factory.py +++ b/geomagio/imfv283/StreamIMFV283Factory.py @@ -1,4 +1,5 @@ """Factory to load IMFV283 files from an input StreamIMFV283Factory.""" + from __future__ import absolute_import from .IMFV283Factory import IMFV283Factory diff --git a/geomagio/imfv283/__init__.py b/geomagio/imfv283/__init__.py index de3a6aeb8984c9e87e3ce984e0e536a1e80d71cc..9a38dcfdaff4e20f6e96374ed1c521b45f2d142d 100644 --- a/geomagio/imfv283/__init__.py +++ b/geomagio/imfv283/__init__.py @@ -3,6 +3,7 @@ Based on documentation at: http://http://www.intermagnet.org/data-donnee/formats/imfv283e-eng.php """ + from __future__ import absolute_import from .GOESIMFV283Factory import GOESIMFV283Factory diff --git a/geomagio/metadata/MetadataCategory.py b/geomagio/metadata/MetadataCategory.py index 44c5608b6febabc9a4c42b7fe28c798dd2fe6192..bb33eda18439ff3d7233a3e96af6b2a55fe91bc1 100644 --- a/geomagio/metadata/MetadataCategory.py +++ b/geomagio/metadata/MetadataCategory.py @@ -1,5 +1,6 @@ from enum import Enum + # known category values as enumeration class MetadataCategory(str, Enum): ADJUSTED_MATRIX = "adjusted-matrix" diff --git a/geomagio/pcdcp/PCDCPFactory.py b/geomagio/pcdcp/PCDCPFactory.py index f7633d2c0ebf525805f6e18887b095426a9e07b5..217fa5dece339a1a5706c37b39f452632f796586 100644 --- a/geomagio/pcdcp/PCDCPFactory.py +++ b/geomagio/pcdcp/PCDCPFactory.py @@ -1,4 +1,5 @@ """Factory that loads PCDCP Files.""" + from __future__ import absolute_import import obspy.core diff --git a/geomagio/pcdcp/PCDCPParser.py b/geomagio/pcdcp/PCDCPParser.py index 176b389412730f2b0650b3c2208b65a514be9f50..1f5ad2ba6b4960703d9d183e3c4b1d0b5cbdbf5d 100644 --- a/geomagio/pcdcp/PCDCPParser.py +++ b/geomagio/pcdcp/PCDCPParser.py @@ -1,6 +1,5 @@ """Parsing methods for the PCDCP Format.""" - import numpy # values that represent missing data points in PCDCP @@ -93,7 +92,7 @@ class PCDCPParser(object): Adds channel values to ``self.data``. """ values = line.split() - for (value, column) in zip(values, self._parsedata): + for value, column in zip(values, self._parsedata): column.append(value) def _post_process(self): diff --git a/geomagio/pcdcp/PCDCPWriter.py b/geomagio/pcdcp/PCDCPWriter.py index f974a8b3eb197abfa54db91e5a3f518b12166a0a..ebc393dc80522e49a2855a5ff9d92f3922fe5ee7 100644 --- a/geomagio/pcdcp/PCDCPWriter.py +++ b/geomagio/pcdcp/PCDCPWriter.py @@ -193,9 +193,11 @@ class PCDCPWriter(object): totalMinutes, tw=time_width, *[ - self.empty_value - if numpy.isnan(val) - else int(round(val * data_multiplier)) + ( + self.empty_value + if numpy.isnan(val) + else int(round(val * data_multiplier)) + ) for val in values ], dw=data_width diff --git a/geomagio/pcdcp/StreamPCDCPFactory.py b/geomagio/pcdcp/StreamPCDCPFactory.py index ba52bb6be05162f6e1e0fc7be146bf31b7eabbc8..a37e3d890c4c060d051eac7018d39daf98090fd7 100644 --- a/geomagio/pcdcp/StreamPCDCPFactory.py +++ b/geomagio/pcdcp/StreamPCDCPFactory.py @@ -1,4 +1,5 @@ """Factory to load PCDCP files from an input StreamPCDCPFactory.""" + from __future__ import absolute_import from .PCDCPFactory import PCDCPFactory diff --git a/geomagio/pcdcp/__init__.py b/geomagio/pcdcp/__init__.py index fd88ed7f42b6b78bbd2eb8c1c40c1a896018d4cf..308618e29aca59a353638e5f2d3537645bdccbde 100644 --- a/geomagio/pcdcp/__init__.py +++ b/geomagio/pcdcp/__init__.py @@ -1,5 +1,6 @@ """IO Module for PCDCP Format """ + from __future__ import absolute_import from .PCDCPFactory import PCDCPFactory, PCDCP_FILE_PATTERN diff --git a/geomagio/processing/__init__.py b/geomagio/processing/__init__.py index 573ec1ae8cd68ee4712983d6d3610cc91538e793..a31e13c3b30dec782b9d94936a0d9ac45413d5d1 100644 --- a/geomagio/processing/__init__.py +++ b/geomagio/processing/__init__.py @@ -3,6 +3,7 @@ Note that these implementations are subject to change, and should be considered less stable than other packages in the library. """ + from .factory import get_edge_factory, get_miniseed_factory from .derived import adjusted, average, sqdist_minute from .filters import minute_filter, second_filter diff --git a/geomagio/residual/CalFileFactory.py b/geomagio/residual/CalFileFactory.py index 5b626ca2f5ec8f1d8412e4ce659b7f6e0ef391a0..8e5f12df4b57ca7baeddaf9b2879c56eef610a54 100644 --- a/geomagio/residual/CalFileFactory.py +++ b/geomagio/residual/CalFileFactory.py @@ -1,5 +1,6 @@ """Factory for CalFiles, used by MagProc. """ + from __future__ import print_function from typing import List diff --git a/geomagio/residual/SpreadsheetAbsolutesFactory.py b/geomagio/residual/SpreadsheetAbsolutesFactory.py index a2daffed71530857ad8d648a37643b39cfffb695..a3dfd763013fab86a29ca0688daf60f3e988e5f4 100644 --- a/geomagio/residual/SpreadsheetAbsolutesFactory.py +++ b/geomagio/residual/SpreadsheetAbsolutesFactory.py @@ -323,7 +323,7 @@ class SpreadsheetAbsolutesFactory(object): end_filename = f"{observatory}-{endtime.datetime:%Y%j%H%M}.xlsm" all_dirs = [] all_files = [] - for (dirpath, _, filenames) in os.walk(self.base_directory): + for dirpath, _, filenames in os.walk(self.base_directory): # accumulate dirpaths and filenames before sorting on filenames all_dirs += len(filenames) * [dirpath] all_files += filenames diff --git a/geomagio/residual/SpreadsheetSummaryFactory.py b/geomagio/residual/SpreadsheetSummaryFactory.py index 3ed439325b6b44f5ae00e4fabe401cf9406d6240..ae454d3f19020cff06bcd5a8a0b1af466ad101fb 100644 --- a/geomagio/residual/SpreadsheetSummaryFactory.py +++ b/geomagio/residual/SpreadsheetSummaryFactory.py @@ -62,7 +62,7 @@ class SpreadsheetSummaryFactory(object): end_filename = f"{observatory}{endtime.datetime:%Y%j%H%M}.xlsm" all_dirs = [] all_files = [] - for (dirpath, _, filenames) in os.walk(self.base_directory): + for dirpath, _, filenames in os.walk(self.base_directory): # accumulate dirpaths and filenames before sorting on filenames all_dirs += len(filenames) * [dirpath] all_files += filenames diff --git a/geomagio/temperature/StreamTEMPFactory.py b/geomagio/temperature/StreamTEMPFactory.py index 356f6a598ff8224c582a08a005a2a5a971c92abb..734a2d61c6e8d56d5d9eec37ca20733f3f99760a 100644 --- a/geomagio/temperature/StreamTEMPFactory.py +++ b/geomagio/temperature/StreamTEMPFactory.py @@ -1,4 +1,5 @@ """Factory to load temp/volt files from an input StreamTEMPFactory.""" + from __future__ import absolute_import from .TEMPFactory import TEMPFactory diff --git a/geomagio/temperature/TEMPFactory.py b/geomagio/temperature/TEMPFactory.py index fad62a9769ac7c87f9c8ce07f0a0f059580e7c74..b0a37ab502cb27aa82a4e363f1f00d27c06a0476 100644 --- a/geomagio/temperature/TEMPFactory.py +++ b/geomagio/temperature/TEMPFactory.py @@ -1,4 +1,5 @@ """Factory that loads temp/volt Files.""" + from __future__ import absolute_import from ..TimeseriesFactory import TimeseriesFactory diff --git a/geomagio/temperature/__init__.py b/geomagio/temperature/__init__.py index 77e464af4dc09e01f6e4313d9adf81d6d6c9db50..7b64a57f7d29694a55d73b8dab306356d83efe08 100644 --- a/geomagio/temperature/__init__.py +++ b/geomagio/temperature/__init__.py @@ -1,5 +1,6 @@ """IO Module for TEMP Format """ + from __future__ import absolute_import from .TEMPFactory import TEMPFactory diff --git a/geomagio/vbf/StreamVBFFactory.py b/geomagio/vbf/StreamVBFFactory.py index a8962c6303aa64a8e95b724552e2a5bfc73eb149..86e0f85ad976a750b5983ca27c7cd1ea4cf4e512 100644 --- a/geomagio/vbf/StreamVBFFactory.py +++ b/geomagio/vbf/StreamVBFFactory.py @@ -1,4 +1,5 @@ """Factory to load VBF files from an input StreamVBFFactory.""" + from __future__ import absolute_import from .VBFFactory import VBFFactory diff --git a/geomagio/vbf/VBFFactory.py b/geomagio/vbf/VBFFactory.py index 5d96582b2f7ebec299c864e820ee31ddb578b953..3466a833b953b168f0312c9f20f8ac0ec0a0a777 100644 --- a/geomagio/vbf/VBFFactory.py +++ b/geomagio/vbf/VBFFactory.py @@ -1,4 +1,5 @@ """Factory that loads VBF Files.""" + from __future__ import absolute_import from ..TimeseriesFactory import TimeseriesFactory diff --git a/geomagio/vbf/__init__.py b/geomagio/vbf/__init__.py index 355a551bd0103c7fea1f704c369a788aa0e027d1..f0b694de1daf3294404f77f659df4eefe998bece 100644 --- a/geomagio/vbf/__init__.py +++ b/geomagio/vbf/__init__.py @@ -1,5 +1,6 @@ """IO Module for VBF Format """ + from __future__ import absolute_import from .VBFFactory import VBFFactory diff --git a/migrations/versions/2280fe551e60_initialize_database.py b/migrations/versions/2280fe551e60_initialize_database.py index 01c9d26b4d26d90cf685e0c244245030ab5dd920..0e2fe978e5db08b35986f2f7dd1973f60f7df46a 100644 --- a/migrations/versions/2280fe551e60_initialize_database.py +++ b/migrations/versions/2280fe551e60_initialize_database.py @@ -5,6 +5,7 @@ Revises: Create Date: 2021-04-22 13:06:28.852803 """ + from alembic import op from geomagio.api.db.create import create_db diff --git a/migrations/versions/4324b87e0b3c_drop_metadata_valid_column.py b/migrations/versions/4324b87e0b3c_drop_metadata_valid_column.py index 4bf200c01657d8352aa574f9ef8d52ea9434c4ee..d62dd9fc63d8bcb340ca16e503a4a0473a179e98 100644 --- a/migrations/versions/4324b87e0b3c_drop_metadata_valid_column.py +++ b/migrations/versions/4324b87e0b3c_drop_metadata_valid_column.py @@ -5,6 +5,7 @@ Revises: 2280fe551e60 Create Date: 2021-07-14 15:48:32.154022 """ + from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql diff --git a/test/StreamConverter_test.py b/test/StreamConverter_test.py index 446a4b553340a1646d9344602cdcf7c478a4a096..3fb1ee376ad212324e36089095193ef6c3ab409e 100644 --- a/test/StreamConverter_test.py +++ b/test/StreamConverter_test.py @@ -9,6 +9,7 @@ We are using triangle identities for variables to test with. Specifically For more info on the components see the Notes in ChannelConverterTest.py. """ + import obspy.core import numpy from geomagio import ChannelConverter, StreamConverter diff --git a/test/edge_test/MiniSeedFactory_test.py b/test/edge_test/MiniSeedFactory_test.py index 6b0dbbd91436911d003646887bcd581cc4925df0..3b8ced3b0418d7454da62d0530f83290dd31f890 100644 --- a/test/edge_test/MiniSeedFactory_test.py +++ b/test/edge_test/MiniSeedFactory_test.py @@ -1,4 +1,5 @@ """Tests for MiniSeedFactory.py""" + import io from typing import List diff --git a/test/imfv283_test/IMFV283Parser_test.py b/test/imfv283_test/IMFV283Parser_test.py index 61d5f92b137242198997a6fec73b8053488fe2d5..fb7e5395ab92b0d0648c1033232d6d1c8cde0e94 100644 --- a/test/imfv283_test/IMFV283Parser_test.py +++ b/test/imfv283_test/IMFV283Parser_test.py @@ -1,4 +1,5 @@ """Tests for the IMFV283 Parser class.""" + from __future__ import unicode_literals from numpy.testing import assert_equal