Skip to content

Commit

Permalink
MNT: Update the tests based on the changes in streamcat related funct…
Browse files Browse the repository at this point in the history
…ions. [skip ci]
  • Loading branch information
Taher Chegini committed Apr 26, 2024
1 parent 27dbbb9 commit 57fde22
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_pynhd.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def trib():
def test_streamcat():
nhd_area = pynhd.streamcat("fert", comids=13212248)
assert_close(nhd_area["FERTWS"].item(), 14.358)
nhd_area = pynhd.streamcat("inorgnwetdep_2008", comids=23783629, lakes_only=True)
assert_close(nhd_area["INORGNWETDEP_2008WS"].item(), 1.7746)


def test_epa():
Expand All @@ -45,10 +47,6 @@ def test_epa():
data = pynhd.epa_nhd_catchments([9533477, 1440291], "comid_info")
assert data["comid_info"].loc[1440291, "TOCOMID"] == 1439303

data = pynhd.epa_nhd_catchments(1440291, "catchment_metrics")
assert_close(data["catchment_metrics"].loc[1440291, "AvgWetIndxCat"], 579.532)
assert data["metadata"].loc["AvgWetIndxCat", "short_display_name"] == "Wetness Index"


@pytest.mark.xfail(reason="Hydro is unstable.")
def test_nhd_xs_resample():
Expand Down Expand Up @@ -94,6 +92,7 @@ def test_splitcatchment(self):
gdfb = pynhd.pygeoapi(gs, "split_catchment")
assert gdf.catchmentID.iloc[0] == gdfb.catchmentID.iloc[0] == "22294818"

@pytest.mark.xfail(reason="The xs endpoints of PyGeoAPI are not working.")
def test_elevation_profile(self):
line = LineString([(-103.801086, 40.26772), (-103.80097, 40.270568)])
gs = gpd.GeoDataFrame(
Expand All @@ -115,6 +114,7 @@ def test_elevation_profile(self):
assert_close(gdf.iloc[-1, 2], expected)
assert_close(gdfb.iloc[-1, 2], expected)

@pytest.mark.xfail(reason="The xs endpoints of PyGeoAPI are not working.")
def test_endpoints_profile(self):
coords = [(-103.801086, 40.26772), (-103.80097, 40.270568)]
gs = gpd.GeoDataFrame(
Expand All @@ -136,6 +136,7 @@ def test_endpoints_profile(self):
assert_close(gdf.iloc[-1, 2], expected)
assert_close(gdfb.iloc[-1, 2], expected)

@pytest.mark.xfail(reason="The xs endpoints of PyGeoAPI are not working.")
def test_cross_section(self):
coords = (-103.80119, 40.2684)
gs = gpd.GeoDataFrame(
Expand Down

0 comments on commit 57fde22

Please sign in to comment.