Skip to content

Commit

Permalink
Test code branch indicated as a "dev goal" in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
trey-stafford committed Oct 30, 2024
1 parent 52037e9 commit 7c64991
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion icepyx/core/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def geodataframe(
"""

# If extent_type is a polygon AND from a file, create a geopandas geodataframe from it
# DevGoal: Currently this branch isn't tested...
if file is True:
if extent_type == "polygon":
return gpd.read_file(spatial_extent)
Expand Down
5 changes: 5 additions & 0 deletions icepyx/tests/unit/test_spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,11 @@ def test_gdf_from_list_tuples():
assert obs.geometry[0].equals(exp.geometry[0])


def test_gdf_raises_error_bounding_box_file():
with pytest.raises(TypeError):
spat.geodataframe("bounding_box", "/fake/file/somewhere/polygon.shp")


# Potential tests to include once multipolygon and complex polygons are handled

# def test_gdf_from_strpoly_one_simple():
Expand Down

0 comments on commit 7c64991

Please sign in to comment.