Skip to content

Commit 44a5fa4

Browse files
Fix typepigeon version to pre 2 & test failures due to USGS response change (#60)
* Resolve issues with automated tests - Fix typepigeon version to pre 2 - Fix polygon c'tor input shell array type not being 'number' - Fix reference for updated hwm response - Use better criteria for testing latest storm - Update reference for USGS flood storms test as API response is updated - Update flood event test refrence for updated USGS response - Update usgs flood events test reference for updated USGS response - Coops data within empty region explicitely return empty - Documentation update & bugfix
1 parent c4220ad commit 44a5fa4

File tree

11 files changed

+1358
-1349
lines changed

11 files changed

+1358
-1349
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- run: pip install ".[test]" pytest-cov pytest-xdist
7272
- run: pytest -n auto --cov . --cov-report xml:coverage.xml
7373
- run: coverage report -m
74-
- uses: codecov/codecov-action@master
74+
- uses: codecov/codecov-action@main
7575
with:
7676
token: ${{ secrets.CODECOV_TOKEN }}
7777
files: coverage.xml

docs/source/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import os
1111
import subprocess
1212
import sys
13+
from datetime import datetime
1314
from os import PathLike
1415
from pathlib import Path
1516

@@ -40,11 +41,11 @@ def repository_root(path: PathLike = None) -> Path:
4041
)
4142

4243
# -- Project information -----------------------------------------------------
43-
metadata = toml.load("../../pyproject.toml")["tool"]["poetry"]
44+
metadata = toml.load("../../pyproject.toml")["project"]
4445

4546
project = metadata["name"]
46-
author = metadata["authors"][0]
47-
copyright = f"2021, {author}"
47+
author = ", ".join([m["name"] for m in metadata["authors"]])
48+
copyright = f"{datetime.today().year}, {author}"
4849

4950
# The full version, including alpha/beta/rc tags
5051
try:

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[project]
22
name = "stormevents"
33
description = "Python interfaces for observational data surrounding named storm events"
4-
authors = [{ name = "Zach Burnett", email = "[email protected]" }]
4+
authors = [
5+
{ name = "Zach Burnett", email = "[email protected]" },
6+
{ name = "Soroosh Mani", email = "[email protected]"}
7+
]
58
readme = "README.md"
69
requires-python = ">=3.6"
710
license = { file = "LICENSE" }
@@ -16,15 +19,15 @@ dependencies = [
1619
"requests",
1720
"searvey >=0.2.0,<1.0",
1821
"shapely >=1.8",
19-
"typepigeon >=1.0.5",
22+
"typepigeon >=1.0.5, <2",
2023
"xarray",
2124
]
2225
dynamic = ["version"]
2326

2427
[project.optional-dependencies]
2528
test = ['pytest', 'pytest-cov', 'pytest-socket', 'pytest-xdist']
2629
style = ['black', 'reorder-python-imports']
27-
docs = ['m2r2', 'sphinx', 'sphinx-rtd-theme', 'toml']
30+
docs = ['dunamai', 'm2r2', 'sphinx', 'sphinx-rtd-theme', 'toml']
2831

2932
[project.urls]
3033
repository = 'https://github.com/oceanmodeling/StormEvents.git'

stormevents/nhc/track.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ def isotachs(
821821
row[["longitude", "latitude"]].values[None, :],
822822
],
823823
axis=0,
824-
)
824+
).astype(float)
825825

826826
quadrants.append(Polygon(vertices))
827827

stormevents/stormevent.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from os import PathLike
66
from typing import List
77

8+
import geopandas as gpd
89
import pandas
910
import xarray
1011
from searvey.coops import COOPS_Interval
@@ -481,7 +482,11 @@ def coops_product_within_region(
481482
start=self.start_date, end=self.end_date, relative=end_date
482483
)
483484

484-
stations = coops_stations_within_region(region=region, station_status=status)
485+
stations = gpd.GeoDataFrame()
486+
if not region.is_empty:
487+
stations = coops_stations_within_region(
488+
region=region, station_status=status
489+
)
485490

486491
if len(stations) > 0:
487492
stations_data = []

tests/data/reference/test_storm_event_high_water_marks/florence2018_hwm.csv

Lines changed: 644 additions & 644 deletions
Large diffs are not rendered by default.

tests/data/reference/test_usgs_flood_event/florence2018.csv

Lines changed: 644 additions & 644 deletions
Large diffs are not rendered by default.
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
usgs_id,name,year,description,event_type,event_status,coordinator,instruments,last_updated,last_updated_by,start_date,end_date
22
7,FEMA 2013 exercise,2013,Ardent/Sentry 2013 FEMA Exercise,HURRICANE,COMPLETED,36,[],,,2013-05-15 04:00:00,2013-05-23 04:00:00
3-
8,Wilma,2005,"Category 3 in west FL.
4-
Hurricane Wilma was the most intense tropical cyclone ever recorded in the Atlantic basin. Part of the record breaking 2005 Atlantic hurricane season.",HURRICANE,COMPLETED,515,[],,,2005-10-20 00:00:00,2005-10-31 00:00:00
5-
18,Isaac Aug 2012,2012,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,36,[],2018-09-10 14:14:55.378445,35.0,2012-08-27 05:00:00,2012-09-02 05:00:00
6-
19,Rita,2005,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,515,[],,,2005-09-23 04:00:00,2005-09-25 04:00:00
7-
23,Irene,2011,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,36,[],,,2011-08-26 04:00:00,2011-08-29 04:00:00
8-
24,Sandy,2012,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,36,[],,,2012-10-21 04:00:00,2012-10-30 04:00:00
9-
25,Gustav,2008,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,515,[],,,2008-08-31 04:00:00,2008-09-03 04:00:00
10-
26,Ike,2008,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,515,[],,,2008-09-11 04:00:00,2008-09-12 04:00:00
11-
119,Joaquin,2015,Hurricane/Tropical storm with intense waves predicted in the Atlantic,HURRICANE,COMPLETED,36,[],,,2015-10-01 04:00:00,2015-10-08 04:00:00
12-
131,Hermine,2016,Small deployment of Initial landfall of Hermine is in the Big Bend area of FL to assist NWS modeling,HURRICANE,COMPLETED,3,[],,,2016-09-01 04:00:00,2016-09-07 04:00:00
13-
133,Isabel September 2003,2003,"Hurricane Isabel formed near the Cape Verde Islands from a tropical wave on Sep. 6 and reached peak winds of 165 mph (265 km/h) on Sep. 11. It made landfall on Sep. 18 in North Carolina, killing 16 and damaging over $5 billion of property.",HURRICANE,COMPLETED,515,[],,,2003-09-06 05:00:00,2003-09-30 05:00:00
14-
135,Matthew October 2016,2016,Hurricane Matthew,HURRICANE,COMPLETED,35,[],,,2016-10-03 04:00:00,2016-10-30 04:00:00
15-
180,Harvey Aug 2017,2017,Hurricane Harvey Texas Coast August 2017,HURRICANE,COMPLETED,35,[],,,2017-08-24 05:00:00,2017-09-24 05:00:00
16-
182,Irma September 2017,2017,"Hurricane affecting PR, USVI and maybe mainland US",HURRICANE,COMPLETED,36,[],2018-09-07 15:07:25.174430,35.0,2017-09-03 05:00:00,2017-09-30 05:00:00
17-
189,Maria September 2017,2017,TD15,HURRICANE,COMPLETED,36,[],2020-10-05 19:41:33.520407,1.0,2017-09-17 04:00:00,2017-10-02 04:00:00
18-
190,Jose September 2017,2017,Tropical storm impacting the northeast us,HURRICANE,COMPLETED,36,[],2020-10-05 19:40:26.866120,1.0,2017-09-18 04:00:00,2017-09-25 04:00:00
19-
196,Nate October 2017,2017,TD16 will be developing into Nate. North Gulf deployment,HURRICANE,COMPLETED,36,[],2018-09-07 15:06:46.782674,35.0,2017-10-05 05:00:00,2017-10-14 05:00:00
3+
8,2005 Wilma,2005,"Category 3 in west FL.
4+
Hurricane Wilma was the most intense tropical cyclone ever recorded in the Atlantic basin. Part of the record breaking 2005 Atlantic hurricane season.",HURRICANE,COMPLETED,515,[],2022-09-08 20:02:25.510152,1.0,2005-10-20 04:00:00,2005-10-31 05:00:00
5+
18,2012 Isaac,2012,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,36,[],2022-09-09 14:57:23.815290,2062.0,2012-08-27 04:00:00,2012-09-02 04:00:00
6+
19,2005 Rita,2005,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,515,[],2022-09-08 20:10:38.533682,1.0,2005-09-23 04:00:00,2005-09-25 04:00:00
7+
23,2011 Irene,2011,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,36,[],2022-09-09 15:04:03.637296,2062.0,2011-08-26 04:00:00,2011-08-29 04:00:00
8+
24,2012 Sandy,2012,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,36,[],2022-09-09 15:04:13.715276,2062.0,2012-10-21 04:00:00,2012-10-30 04:00:00
9+
25,2008 Gustav,2008,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,515,[],2022-09-09 15:04:24.293240,2062.0,2008-08-31 04:00:00,2008-09-03 04:00:00
10+
26,2008 Ike,2008,historical hurricane data loaded by the data archive team,HURRICANE,COMPLETED,515,[],2022-09-09 15:04:47.855383,2062.0,2008-09-11 04:00:00,2008-09-12 04:00:00
11+
119,2015 Joaquin,2015,Hurricane/Tropical storm with intense waves predicted in the Atlantic,HURRICANE,COMPLETED,36,[],2022-09-09 16:08:59.765383,2062.0,2015-10-01 04:00:00,2015-10-08 04:00:00
12+
131,2016 Hermine,2016,Small deployment of Initial landfall of Hermine is in the Big Bend area of FL to assist NWS modeling,HURRICANE,COMPLETED,3,[],2022-09-09 16:23:30.939594,2062.0,2016-09-01 04:00:00,2016-09-07 04:00:00
13+
133,2003 Isabel,2003,"Hurricane Isabel formed near the Cape Verde Islands from a tropical wave on Sep. 6 and reached peak winds of 165 mph (265 km/h) on Sep. 11. It made landfall on Sep. 18 in North Carolina, killing 16 and damaging over $5 billion of property.",HURRICANE,COMPLETED,515,[],2022-09-09 16:24:28.501226,2062.0,2003-09-06 04:00:00,2003-09-30 04:00:00
14+
135,2016 Matthew,2016,Hurricane Matthew,HURRICANE,COMPLETED,35,[],2022-09-09 16:25:00.672612,2062.0,2016-10-03 04:00:00,2016-10-30 04:00:00
15+
180,2017 Harvey,2017,Hurricane Harvey Texas Coast August 2017,HURRICANE,COMPLETED,35,[],2022-09-09 17:27:26.943616,2062.0,2017-08-24 04:00:00,2017-09-24 04:00:00
16+
182,2017 Irma,2017,"Hurricane affecting PR, USVI and maybe mainland US",HURRICANE,COMPLETED,36,[],2022-09-09 17:28:15.677235,2062.0,2017-09-03 04:00:00,2017-09-30 04:00:00
17+
189,2017 Maria,2017,TD15,HURRICANE,COMPLETED,36,[],2022-09-09 19:06:47.524544,2062.0,2017-09-17 04:00:00,2017-10-02 04:00:00
18+
190,2017 Jose,2017,Tropical storm impacting the northeast us,HURRICANE,COMPLETED,36,[],2022-09-09 19:07:05.868050,2062.0,2017-09-18 04:00:00,2017-09-25 04:00:00
19+
196,2017 Nate,2017,TD16 will be developing into Nate. North Gulf deployment,HURRICANE,COMPLETED,36,[],2022-09-09 19:08:52.507058,2062.0,2017-10-05 04:00:00,2017-10-14 04:00:00
2020
247,Atlantic Fury Exercise May 2018,2018,"*** Mock Data *** for interagency exercise around Hampton Roads, Virginia during the first two weeks of May, 2018",HURRICANE,COMPLETED,35,[],2018-09-07 15:06:34.421058,35.0,2018-04-23 05:00:00,2018-05-18 05:00:00
21-
284,Isaac Sep 2018,2018,,HURRICANE,COMPLETED,3,[],2018-12-06 16:10:38.342516,3.0,2018-09-11 04:00:00,2018-09-18 04:00:00
22-
287,Michael Oct 2018,2018,storm hit the Mexico Beach area of the Florida panhandle,HURRICANE,COMPLETED,3,[],2018-12-06 16:24:40.504991,3.0,2018-10-08 04:00:00,2018-10-15 04:00:00
21+
284,2018 Isaac,2018,,HURRICANE,COMPLETED,3,[],2022-09-09 19:33:02.531819,2062.0,2018-09-11 04:00:00,2018-09-18 04:00:00
22+
287,2018 Michael,2018,storm hit the Mexico Beach area of the Florida panhandle,HURRICANE,COMPLETED,3,[],2022-09-09 19:32:14.235677,2062.0,2018-10-08 04:00:00,2018-10-15 04:00:00

0 commit comments

Comments
 (0)