Skip to content

Commit 27de548

Browse files
committed
Fixup typeerror message and add test covering check in geodataframe
1 parent 3f923a6 commit 27de548

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Diff for: icepyx/core/spatial.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def geodataframe(
7979

8080
if isinstance(spatial_extent, str):
8181
raise TypeError(
82-
f"Expected list of floats or Polygon, received {spatial_extent=}"
82+
f"Expected list of floats, list of tuples of floats, or Polygon, received {spatial_extent=}"
8383
)
8484

8585
if isinstance(spatial_extent, Polygon):

Diff for: icepyx/tests/unit/test_spatial.py

+7
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,13 @@ def test_gdf_raises_error_bounding_box_file():
437437
spat.geodataframe("bounding_box", "/fake/file/somewhere/polygon.shp", file=True)
438438

439439

440+
def test_gdf_raises_error_string_file_false():
441+
with pytest.raises(TypeError):
442+
spat.geodataframe(
443+
"bounding_box", "/fake/file/somewhere/polygon.shp", file=False
444+
)
445+
446+
440447
# Potential tests to include once multipolygon and complex polygons are handled
441448

442449
# def test_gdf_from_strpoly_one_simple():

0 commit comments

Comments
 (0)