Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 18, 2023
1 parent 0cf7ce3 commit 91ba8b3
Show file tree
Hide file tree
Showing 7 changed files with 295 additions and 278 deletions.
5 changes: 4 additions & 1 deletion observer/ioc/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,8 @@ def list_ioc_stations(
credential: CredentialAIO | None = None,
) -> list[str]:
fs = get_obs_fs(credential=credential)
existing = [parquet.split("/")[-1].split(".")[0] for parquet in fs.ls(f"{get_settings().container_name}/ioc/stations")]
existing = [
parquet.split("/")[-1].split(".")[0]
for parquet in fs.ls(f"{get_settings().container_name}/ioc/stations")
]
return existing
8 changes: 4 additions & 4 deletions observer/ioc/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ def retrieve_ioc_data(
url=url,
client=http_client,
rate_limit=rate_limit,
)
),
)
with http_client:
logger.debug("Starting data retrieval")
results = multifutures.multithread(
func=fetch_url,
func_kwargs=kwargs,
check=False,
n_workers=n_threads
n_workers=n_threads,
)
logger.debug("Finished data retrieval")
multifutures.check_results(results)
Expand Down Expand Up @@ -197,7 +197,7 @@ def group_results(
logger.debug("%s: Unique timestamps: %d", ioc_code, len(df))
else:
logger.warning("%s: No data. Creating a dummy dataframe", ioc_code)
df = pd.DataFrame(columns=["time"], dtype='datetime64[ns]').set_index("time")
df = pd.DataFrame(columns=["time"], dtype="datetime64[ns]").set_index("time")
dataframes[ioc_code] = df
logger.debug("%s: Finished conversion to pandas", ioc_code)

Expand Down Expand Up @@ -233,7 +233,7 @@ def scrape_ioc(
# This is a CPU heavy process, so we are using multiprocessing here
parsed_responses: list[multifutures.FutureResult] = parse_ioc_responses(
ioc_responses=ioc_responses,
n_processes=n_processes
n_processes=n_processes,
)

# OK, now we have a list of dataframes. We need to group them per ioc_code, concatenate them and remove duplicates
Expand Down
1 change: 0 additions & 1 deletion observer/notify.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations


import functools
import logging

Expand Down
306 changes: 157 additions & 149 deletions requirements/requirements-dev.txt

Large diffs are not rendered by default.

233 changes: 119 additions & 114 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,114 +1,119 @@
adlfs==2023.10.0 ; python_version >= "3.10" and python_version < "4.0"
aiohttp==3.9.1 ; python_version >= "3.10" and python_version < "4.0"
aiosignal==1.3.1 ; python_version >= "3.10" and python_version < "4.0"
annotated-types==0.6.0 ; python_version >= "3.10" and python_version < "4.0"
anyio==4.1.0 ; python_version >= "3.10" and python_version < "4.0"
asciitree==0.3.3 ; python_version >= "3.10" and python_version < "4.0"
async-timeout==4.0.3 ; python_version >= "3.10" and python_version < "3.11"
attrs==23.1.0 ; python_version >= "3.10" and python_version < "4.0"
azure-common==1.1.28 ; python_version >= "3.10" and python_version < "4.0"
azure-core==1.29.5 ; python_version >= "3.10" and python_version < "4.0"
azure-datalake-store==0.0.53 ; python_version >= "3.10" and python_version < "4.0"
azure-identity==1.15.0 ; python_version >= "3.10" and python_version < "4.0"
azure-keyvault-certificates==4.7.0 ; python_version >= "3.10" and python_version < "4.0"
azure-keyvault-keys==4.8.0 ; python_version >= "3.10" and python_version < "4.0"
azure-keyvault-secrets==4.7.0 ; python_version >= "3.10" and python_version < "4.0"
azure-keyvault==4.2.0 ; python_version >= "3.10" and python_version < "4.0"
azure-storage-blob==12.19.0 ; python_version >= "3.10" and python_version < "4.0"
beautifulsoup4==4.12.2 ; python_version >= "3.10" and python_version < "4.0"
bottleneck==1.3.7 ; python_version >= "3.10" and python_version < "4.0"
certifi==2023.11.17 ; python_version >= "3.10" and python_version < "4.0"
cffi==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
cftime==1.6.3 ; python_version >= "3.10" and python_version < "4.0"
charset-normalizer==3.3.2 ; python_version >= "3.10" and python_version < "4.0"
click-plugins==1.1.1 ; python_version >= "3.10" and python_version < "4.0"
click==8.1.7 ; python_version >= "3.10" and python_version < "4.0"
cligj==0.7.2 ; python_version >= "3.10" and python_version < "4"
cloudpickle==3.0.0 ; python_version >= "3.10" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0"
cramjam==2.7.0 ; python_version >= "3.10" and python_version < "4.0"
cryptography==41.0.7 ; python_version >= "3.10" and python_version < "4.0"
dask[complete]==2023.12.0 ; python_version >= "3.10" and python_version < "4.0"
dataretrieval==1.0.6 ; python_version >= "3.10" and python_version < "4.0"
deprecated==1.2.14 ; python_version >= "3.10" and python_version < "4.0"
erddapy==2.2.0 ; python_version >= "3.10" and python_version < "4.0"
exceptiongroup==1.2.0 ; python_version >= "3.10" and python_version < "3.11"
fasteners==0.19 ; python_version >= "3.10" and python_version < "4.0"
fastparquet==2023.10.1 ; python_version >= "3.10" and python_version < "4.0"
fiona==1.9.5 ; python_version >= "3.10" and python_version < "4.0"
flox==0.8.5 ; python_version >= "3.10" and python_version < "4.0"
frozenlist==1.4.0 ; python_version >= "3.10" and python_version < "4.0"
fsspec==2023.12.1 ; python_version >= "3.10" and python_version < "4.0"
geopandas==0.14.1 ; python_version >= "3.10" and python_version < "4.0"
h11==0.14.0 ; python_version >= "3.10" and python_version < "4.0"
h5netcdf==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
h5py==3.10.0 ; python_version >= "3.10" and python_version < "4.0"
html5lib==1.1 ; python_version >= "3.10" and python_version < "4.0"
httpcore==1.0.2 ; python_version >= "3.10" and python_version < "4.0"
httpx==0.25.2 ; python_version >= "3.10" and python_version < "4.0"
idna==3.6 ; python_version >= "3.10" and python_version < "4.0"
importlib-metadata==7.0.0 ; python_version >= "3.10" and python_version < "4.0"
importlib-resources==6.1.1 ; python_version >= "3.10" and python_version < "4.0"
isodate==0.6.1 ; python_version >= "3.10" and python_version < "4.0"
limits==3.7.0 ; python_version >= "3.10" and python_version < "4.0"
llvmlite==0.41.1 ; python_version >= "3.10" and python_version < "4.0"
locket==1.0.0 ; python_version >= "3.10" and python_version < "4.0"
lxml==4.9.3 ; python_version >= "3.10" and python_version < "4.0"
lz4==4.3.2 ; python_version >= "3.10" and python_version < "4.0"
markdown-it-py==3.0.0 ; python_version >= "3.10" and python_version < "4.0"
mdurl==0.1.2 ; python_version >= "3.10" and python_version < "4.0"
msal-extensions==1.1.0 ; python_version >= "3.10" and python_version < "4.0"
msal==1.26.0 ; python_version >= "3.10" and python_version < "4.0"
multidict==6.0.4 ; python_version >= "3.10" and python_version < "4.0"
multifutures==0.1.2 ; python_version >= "3.10" and python_version < "4.0"
netcdf4==1.6.5 ; python_version >= "3.10" and python_version < "4.0"
numba==0.58.1 ; python_version >= "3.10" and python_version < "4.0"
numbagg==0.6.7 ; python_version >= "3.10" and python_version < "4.0"
numcodecs==0.12.1 ; python_version >= "3.10" and python_version < "4.0"
numpy-groupies==0.10.2 ; python_version >= "3.10" and python_version < "4.0"
numpy==1.26.2 ; python_version >= "3.10" and python_version < "4.0"
opt-einsum==3.3.0 ; python_version >= "3.10" and python_version < "4.0"
packaging==23.2 ; python_version >= "3.10" and python_version < "4.0"
pandas==2.1.4 ; python_version >= "3.10" and python_version < "4.0"
partd==1.4.1 ; python_version >= "3.10" and python_version < "4.0"
platformdirs==4.1.0 ; python_version >= "3.10" and python_version < "4.0"
pooch==1.8.0 ; python_version >= "3.10" and python_version < "4.0"
portalocker==2.8.2 ; python_version >= "3.10" and python_version < "4.0"
pyarrow-hotfix==0.6 ; python_version >= "3.10" and python_version < "4.0"
pyarrow==14.0.1 ; python_version >= "3.10" and python_version < "4.0"
pycparser==2.21 ; python_version >= "3.10" and python_version < "4.0"
pydantic-core==2.14.5 ; python_version >= "3.10" and python_version < "4.0"
pydantic-settings==2.1.0 ; python_version >= "3.10" and python_version < "4.0"
pydantic==2.5.2 ; python_version >= "3.10" and python_version < "4.0"
pygments==2.17.2 ; python_version >= "3.10" and python_version < "4.0"
pyjwt[crypto]==2.8.0 ; python_version >= "3.10" and python_version < "4.0"
pyproj==3.6.1 ; python_version >= "3.10" and python_version < "4.0"
python-dateutil==2.8.2 ; python_version >= "3.10" and python_version < "4.0"
python-dotenv==1.0.0 ; python_version >= "3.10" and python_version < "4.0"
pytz==2023.3.post1 ; python_version >= "3.10" and python_version < "4.0"
pywin32==306 ; python_version >= "3.10" and python_version < "4.0" and platform_system == "Windows"
pyyaml==6.0.1 ; python_version >= "3.10" and python_version < "4.0"
requests==2.31.0 ; python_version >= "3.10" and python_version < "4.0"
rich==13.7.0 ; python_version >= "3.10" and python_version < "4.0"
scipy==1.11.4 ; python_version >= "3.10" and python_version < "4.0"
searvey==0.3.1 ; python_version >= "3.10" and python_version < "4.0"
setuptools==69.0.2 ; python_version >= "3.10" and python_version < "4.0"
shapely==2.0.2 ; python_version >= "3.10" and python_version < "4.0"
shellingham==1.5.4 ; python_version >= "3.10" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
sniffio==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
soupsieve==2.5 ; python_version >= "3.10" and python_version < "4.0"
tenacity==8.2.3 ; python_version >= "3.10" and python_version < "4.0"
toolz==0.12.0 ; python_version >= "3.10" and python_version < "4.0"
tqdm==4.66.1 ; python_version >= "3.10" and python_version < "4.0"
typer[all]==0.9.0 ; python_version >= "3.10" and python_version < "4.0"
typing-extensions==4.8.0 ; python_version >= "3.10" and python_version < "4.0"
tzdata==2023.3 ; python_version >= "3.10" and python_version < "4.0"
urllib3==2.1.0 ; python_version >= "3.10" and python_version < "4.0"
webencodings==0.5.1 ; python_version >= "3.10" and python_version < "4.0"
wrapt==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
xarray==2023.12.0 ; python_version >= "3.10" and python_version < "4.0"
xarray[accel,io,parallel]==2023.12.0 ; python_version >= "3.10" and python_version < "4.0"
yarl==1.9.4 ; python_version >= "3.10" and python_version < "4.0"
zarr==2.16.1 ; python_version >= "3.10" and python_version < "4.0"
zipp==3.17.0 ; python_version >= "3.10" and python_version < "4.0"
adlfs==2023.10.0 ; python_version >= "3.9" and python_version < "4"
aiohttp==3.9.1 ; python_version >= "3.9" and python_version < "4"
aiosignal==1.3.1 ; python_version >= "3.9" and python_version < "4"
annotated-types==0.6.0 ; python_version >= "3.9" and python_version < "4.0"
anyio==4.1.0 ; python_version >= "3.9" and python_version < "4"
asciitree==0.3.3 ; python_version >= "3.9" and python_version < "4"
async-timeout==4.0.3 ; python_version >= "3.9" and python_version < "3.11"
attrs==23.1.0 ; python_version >= "3.9" and python_version < "4"
azure-common==1.1.28 ; python_version >= "3.9" and python_version < "4"
azure-core==1.29.5 ; python_version >= "3.9" and python_version < "4"
azure-datalake-store==0.0.53 ; python_version >= "3.9" and python_version < "4"
azure-identity==1.15.0 ; python_version >= "3.9" and python_version < "4"
azure-keyvault-certificates==4.7.0 ; python_version >= "3.9" and python_version < "4"
azure-keyvault-keys==4.8.0 ; python_version >= "3.9" and python_version < "4"
azure-keyvault-secrets==4.7.0 ; python_version >= "3.9" and python_version < "4"
azure-keyvault==4.2.0 ; python_version >= "3.9" and python_version < "4"
azure-storage-blob==12.19.0 ; python_version >= "3.9" and python_version < "4"
beautifulsoup4==4.12.2 ; python_version >= "3.9" and python_version < "4.0"
bottleneck==1.3.7 ; python_version >= "3.9" and python_version < "4"
certifi==2023.11.17 ; python_version >= "3.9" and python_version < "4"
cffi==1.16.0 ; python_version >= "3.9" and python_version < "4"
cftime==1.6.3 ; python_version >= "3.9" and python_version < "4"
charset-normalizer==3.3.2 ; python_version >= "3.9" and python_version < "4.0"
click-plugins==1.1.1 ; python_version >= "3.9" and python_version < "4.0"
click==8.1.7 ; python_version >= "3.9" and python_version < "4"
cligj==0.7.2 ; python_version >= "3.9" and python_version < "4"
cloudpickle==3.0.0 ; python_version >= "3.9" and python_version < "4"
colorama==0.4.6 ; python_version >= "3.9" and python_version < "4"
cramjam==2.7.0 ; python_version >= "3.9" and python_version < "4"
cryptography==41.0.7 ; python_version >= "3.9" and python_version < "4"
dask[complete]==2023.12.0 ; python_version >= "3.9" and python_version < "4"
dataretrieval==1.0.6 ; python_version >= "3.9" and python_version < "4.0"
deprecated==1.2.14 ; python_version >= "3.9" and python_version < "4.0"
docopt==0.6.2 ; python_version < "3.10" and python_version >= "3.9"
erddapy==2.2.0 ; python_version >= "3.9" and python_version < "4.0"
exceptiongroup==1.2.0 ; python_version >= "3.9" and python_version < "3.11"
fasteners==0.19 ; python_version >= "3.9" and python_version < "4"
fastparquet==2023.10.1 ; python_version >= "3.9" and python_version < "4"
fiona==1.9.5 ; python_version >= "3.9" and python_version < "4.0"
flox==0.8.5 ; python_version >= "3.9" and python_version < "4"
frozenlist==1.4.0 ; python_version >= "3.9" and python_version < "4"
fsspec==2023.12.2 ; python_version >= "3.9" and python_version < "4"
geopandas==0.14.1 ; python_version >= "3.9" and python_version < "4.0"
h11==0.14.0 ; python_version >= "3.9" and python_version < "4"
h5netcdf==1.3.0 ; python_version >= "3.9" and python_version < "4"
h5py==3.10.0 ; python_version >= "3.9" and python_version < "4"
html5lib==1.1 ; python_version >= "3.9" and python_version < "4.0"
httpcore==1.0.2 ; python_version >= "3.9" and python_version < "4"
httpx==0.25.2 ; python_version >= "3.9" and python_version < "4"
idna==3.6 ; python_version >= "3.9" and python_version < "4"
importlib-metadata==7.0.0 ; python_version >= "3.9" and python_version < "4"
importlib-resources==6.1.1 ; python_version >= "3.9" and python_version < "4.0"
isodate==0.6.1 ; python_version >= "3.9" and python_version < "4"
jinja2==3.1.2 ; python_version < "3.10" and python_version >= "3.9"
limits==3.7.0 ; python_version >= "3.9" and python_version < "4.0"
llvmlite==0.41.1 ; python_version >= "3.9" and python_version < "4"
locket==1.0.0 ; python_version >= "3.9" and python_version < "4"
lxml==4.9.3 ; python_version >= "3.9" and python_version < "4.0"
lz4==4.3.2 ; python_version >= "3.9" and python_version < "4"
markdown-it-py==3.0.0 ; python_version >= "3.9" and python_version < "4"
markupsafe==2.1.3 ; python_version < "3.10" and python_version >= "3.9"
mdurl==0.1.2 ; python_version >= "3.9" and python_version < "4"
msal-extensions==1.1.0 ; python_version >= "3.9" and python_version < "4"
msal==1.26.0 ; python_version >= "3.9" and python_version < "4"
multidict==6.0.4 ; python_version >= "3.9" and python_version < "4"
multifutures==0.2.0 ; python_version >= "3.9" and python_version < "4.0"
netcdf4==1.6.5 ; python_version >= "3.9" and python_version < "4"
numba==0.58.1 ; python_version >= "3.9" and python_version < "4"
numbagg==0.6.7 ; python_version >= "3.9" and python_version < "4"
numcodecs==0.12.1 ; python_version >= "3.9" and python_version < "4"
numpy-groupies==0.10.2 ; python_version >= "3.9" and python_version < "4"
numpy==1.26.2 ; python_version >= "3.9" and python_version < "4"
opt-einsum==3.3.0 ; python_version >= "3.9" and python_version < "4"
packaging==23.2 ; python_version >= "3.9" and python_version < "4"
pandas==2.1.4 ; python_version >= "3.9" and python_version < "4"
partd==1.4.1 ; python_version >= "3.9" and python_version < "4"
platformdirs==4.1.0 ; python_version >= "3.9" and python_version < "4"
pooch==1.8.0 ; python_version >= "3.9" and python_version < "4"
portalocker==2.8.2 ; python_version >= "3.9" and python_version < "4"
pyarrow-hotfix==0.6 ; python_version >= "3.9" and python_version < "4"
pyarrow==14.0.1 ; python_version >= "3.9" and python_version < "4"
pycparser==2.21 ; python_version >= "3.9" and python_version < "4"
pydantic-core==2.14.5 ; python_version >= "3.9" and python_version < "4.0"
pydantic-settings==2.1.0 ; python_version >= "3.9" and python_version < "4"
pydantic==2.5.2 ; python_version >= "3.9" and python_version < "4.0"
pydap==3.4.1 ; python_version < "3.10" and python_version >= "3.9"
pygments==2.17.2 ; python_version >= "3.9" and python_version < "4"
pyjwt[crypto]==2.8.0 ; python_version >= "3.9" and python_version < "4"
pyproj==3.6.1 ; python_version >= "3.9" and python_version < "4.0"
python-dateutil==2.8.2 ; python_version >= "3.9" and python_version < "4"
python-dotenv==1.0.0 ; python_version >= "3.9" and python_version < "4"
pytz==2023.3.post1 ; python_version >= "3.9" and python_version < "4"
pywin32==306 ; python_version >= "3.9" and python_version < "4" and platform_system == "Windows"
pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "4"
requests==2.31.0 ; python_version >= "3.9" and python_version < "4.0"
rich==13.7.0 ; python_version >= "3.9" and python_version < "4"
scipy==1.11.4 ; python_version >= "3.9" and python_version < "4"
searvey==0.3.1 ; python_version >= "3.9" and python_version < "4.0"
setuptools==69.0.2 ; python_version >= "3.9" and python_version < "4.0"
shapely==2.0.2 ; python_version >= "3.9" and python_version < "4.0"
shellingham==1.5.4 ; python_version >= "3.9" and python_version < "4"
six==1.16.0 ; python_version >= "3.9" and python_version < "4"
sniffio==1.3.0 ; python_version >= "3.9" and python_version < "4"
soupsieve==2.5 ; python_version >= "3.9" and python_version < "4.0"
tenacity==8.2.3 ; python_version >= "3.9" and python_version < "4"
toolz==0.12.0 ; python_version >= "3.9" and python_version < "4"
tqdm==4.66.1 ; python_version >= "3.9" and python_version < "4.0"
typer[all]==0.9.0 ; python_version >= "3.9" and python_version < "4"
typing-extensions==4.9.0 ; python_version >= "3.9" and python_version < "4"
tzdata==2023.3 ; python_version >= "3.9" and python_version < "4"
urllib3==2.1.0 ; python_version >= "3.9" and python_version < "4.0"
webencodings==0.5.1 ; python_version >= "3.9" and python_version < "4.0"
webob==1.8.7 ; python_version >= "3.9" and python_version < "3.10"
wrapt==1.16.0 ; python_version >= "3.9" and python_version < "4.0"
xarray==2023.12.0 ; python_version >= "3.9" and python_version < "4.0"
xarray[accel,io,parallel]==2023.12.0 ; python_version >= "3.9" and python_version < "4"
yarl==1.9.4 ; python_version >= "3.9" and python_version < "4"
zarr==2.16.1 ; python_version >= "3.9" and python_version < "4"
zipp==3.17.0 ; python_version >= "3.9" and python_version < "4"
1 change: 1 addition & 0 deletions tests/cli_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from typer.testing import CliRunner

from observer.cli import app

runner = CliRunner()
Expand Down
Loading

0 comments on commit 91ba8b3

Please sign in to comment.