Skip to content

Commit 83f72b7

Browse files
authored
Merge pull request #322 from akrherz/260309
260309
2 parents 1076449 + 01f8f74 commit 83f72b7

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ jobs:
6262
python -m pip install . -vv --no-deps
6363
cp pywwa_settings.json-example pywwa_settings.json
6464
# This is a bit brittle, but loads some data
65-
python util/ugcs_update.py --filename=fz18mr25 --date=2025-03-18
6665
python util/merge_hvtec_nwsli.py hvtec.list.20251006.csv
6766
python util/copy_iem_network.py MN_ASOS
6867
python util/copy_iem_network.py NY_COOP
@@ -72,7 +71,8 @@ jobs:
7271
sh util/run_examples.sh
7372
# get pqinsert available as a dummy command
7473
export PATH=$PATH:$(pwd)/tests/bin
75-
python -m pytest -vv --cov=pywwa --cov-report=xml
74+
python -m pytest -vv --cov=pywwa
75+
python -m coverage xml
7676
7777
- name: Run console scripts without database
7878
run: |

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ repos:
1010
types: [python]
1111

1212
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: "v0.15.2"
13+
rev: "v0.15.5"
1414
hooks:
1515
- id: ruff
1616
args: [--fix, --exit-non-zero-on-fix]
1717
- id: ruff-format
1818

1919
- repo: https://github.com/tox-dev/pyproject-fmt
20-
rev: 'v2.16.1'
20+
rev: 'v2.16.2'
2121
hooks:
2222
- id: pyproject-fmt
2323

src/pywwa/workflows/generic.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Generic NWS Product Parser"""
22

3-
# stdlib
43
from datetime import timedelta
54
from functools import partial
65

@@ -11,15 +10,14 @@
1110
from pyiem.nws.ugc import UGCProvider
1211
from shapely.geometry import MultiPolygon
1312

14-
# Local
1513
from pywwa import common
1614
from pywwa.database import get_database, load_nwsli
1715
from pywwa.ldm import bridge
1816

1917
NWSLI_DICT = {}
2018

2119

22-
def process_data(ugc_dict, txn, buf) -> TextProduct:
20+
def process_data(ugc_dict: dict, txn, buf) -> TextProduct:
2321
"""Actually do some processing"""
2422

2523
# Create our TextProduct instance

src/pywwa/workflows/spc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
"""SPC Geo Products Parser!"""
22

3-
# 3rd Party
43
import click
54
from pyiem.nws.products.spcpts import parser
65

7-
# Local
86
from pywwa import LOG, common
97
from pywwa.database import get_database
108
from pywwa.ldm import bridge

tests/workflows/test_spc.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""Test spc."""
2+
3+
import pytest
4+
import pytest_twisted
5+
from pyiem.util import utc
6+
7+
import pywwa
8+
from pywwa.testing import get_example_file
9+
from pywwa.workflows import spc
10+
11+
12+
@pytest.mark.parametrize("database", ["postgis"])
13+
@pytest_twisted.inlineCallbacks
14+
def test_processor(cursor):
15+
"""Test basic parsing."""
16+
data = get_example_file("PTSDY1.txt")
17+
pywwa.CTX["utcnow"] = utc(2021, 3, 25, 13, 8)
18+
pywwa.CTX["disable_xmpp"] = True
19+
prod = spc.real_parser(cursor, data)
20+
yield spc.do_jabber(prod)

0 commit comments

Comments
 (0)