Skip to content

Commit

Permalink
Fixup typeerror message and add test covering check in geodataframe
Browse files Browse the repository at this point in the history
  • Loading branch information
trey-stafford committed Oct 30, 2024
1 parent 3f923a6 commit 27de548
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion icepyx/core/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def geodataframe(

if isinstance(spatial_extent, str):
raise TypeError(
f"Expected list of floats or Polygon, received {spatial_extent=}"
f"Expected list of floats, list of tuples of floats, or Polygon, received {spatial_extent=}"
)

if isinstance(spatial_extent, Polygon):
Expand Down
7 changes: 7 additions & 0 deletions icepyx/tests/unit/test_spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,13 @@ def test_gdf_raises_error_bounding_box_file():
spat.geodataframe("bounding_box", "/fake/file/somewhere/polygon.shp", file=True)


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


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

# def test_gdf_from_strpoly_one_simple():
Expand Down

0 comments on commit 27de548

Please sign in to comment.