Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccbbb5d

Browse files
committed
update optional req for pyshp
1 parent 9db1e35 commit ccbbb5d

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

optional-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ ipykernel
3131

3232
## deps for _county_choropleth.py figure factory
3333
geopandas
34-
shapefile
34+
pyshp
3535
shapely

plotly/figure_factory/_county_choropleth.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -552,22 +552,9 @@ def create_choropleth(fips, values, scope=['usa'], endpts=None,
552552
```
553553
"""
554554
# ensure shapely imported
555-
if not shapely:
556-
raise exceptions.ImportError(
557-
"'shapely' must be installed for this figure factory."
558-
)
559-
560-
# ensure geopandas imported
561-
if not gp:
562-
raise exceptions.ImportError(
563-
"'geopandas' must be installed for this figure factory."
564-
)
565-
566-
# ensure pandas imported
567-
if not pd:
568-
raise exceptions.ImportError(
569-
"'shapefile' must be installed for this figure factory."
570-
)
555+
if not gp or not shapefile or not shapely:
556+
raise ImportError("geopandas, shapefile and shapely must be "
557+
"installed for this figure factory")
571558

572559
if not state_outline:
573560
state_outline = {'color': 'rgb(240, 240, 240)',

0 commit comments

Comments
 (0)