diff --git a/CHANGELOG.md b/CHANGELOG.md index e7b9906bb..4a1a99610 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ All notable changes to this library are documented in this file. ### New Features - Add bling to jabber messages generated from PNS Damage Surveys. +- Add Impact Based Warning tags to jabber channels in the form of +`..` (#11). - Add parser for Wind/Temps Aloft Forecast product (AWIPSID: FD) (#713). - Add `twitter_media` for LSR jabber messages. - Persist Summary LSR product identifier to database (akrherz/pyWWA#150). diff --git a/src/pyiem/nws/products/_vtec_jabber.py b/src/pyiem/nws/products/_vtec_jabber.py index 5342c5c57..771265e7e 100644 --- a/src/pyiem/nws/products/_vtec_jabber.py +++ b/src/pyiem/nws/products/_vtec_jabber.py @@ -13,6 +13,7 @@ def build_channels(prod, segment, vtec) -> list: """Build a list of channels for the given segment/vtec.""" + ps = f"{vtec.phenomena}.{vtec.significance}" channels = [] # Two noisey products that don't default to the main WFO channel if prod.afos[:3] in ["MWW", "RFW"]: @@ -21,20 +22,18 @@ def build_channels(prod, segment, vtec) -> list: channels.append(prod.source[1:]) # GH604 - Append a -ACTION for CON, EXP, CAN actions suffix = f"-{vtec.action}" if vtec.action in ["CON", "EXP", "CAN"] else "" + if vtec.action not in ["EXP", "CAN"] and segment.damagetag is not None: + channels.append(f"{ps}.{segment.damagetag}") channels.append(f"{vtec.s2()}{suffix}") channels.append(prod.afos) channels.append(f"{prod.afos[:3]}...") - channels.append( - f"{vtec.phenomena}.{vtec.significance}.{vtec.office}{suffix}" - ) + channels.append(f"{ps}.{vtec.office}{suffix}") for ugc in segment.ugcs: # per state channels - candidate = f"{vtec.phenomena}.{vtec.significance}.{ugc.state}{suffix}" + candidate = f"{ps}.{ugc.state}{suffix}" if candidate not in channels: channels.append(candidate) - channels.append( - f"{vtec.phenomena}.{vtec.significance}.{str(ugc)}{suffix}" - ) + channels.append(f"{ps}.{str(ugc)}{suffix}") channels.append(str(ugc)) return channels diff --git a/tests/nws/products/test_products_vtec.py b/tests/nws/products/test_products_vtec.py index 3b4273945..4cd4cbb46 100644 --- a/tests/nws/products/test_products_vtec.py +++ b/tests/nws/products/test_products_vtec.py @@ -40,6 +40,14 @@ def filter_warnings(ar, startswith="get_gid"): return [a for a in ar if not a.startswith(startswith)] +def test_230628_ibwthunderstorm(): + """Test the tags created with this SVR.""" + data = get_test_file("SVR/SVRPSR_IBW1.txt") + prod = vtecparser(data.replace("CONSIDERABLE", "DESTRUCTIVE")) + j = prod.get_jabbers("") + assert j[0][2]["channels"].find("SV.W.DESTRUCTIVE") > -1 + + @pytest.mark.parametrize("database", ["postgis"]) def test_230418_index_error(dbcursor): """Test this product for not generating an index error."""