File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 2525
2626def _validate_location (location ):
2727 """Validates and formats location values before setting."""
28- if _isnan (location ):
29- raise ValueError ('Location values cannot contain NaNs, '
30- 'got {!r}' .format (location ))
31- if isinstance (type (location ), collections .abc .Iterable ):
32- raise TypeError ('Expected Iterable object for location, got '
28+ if not isinstance (location , collections .abc .Collection ):
29+ raise TypeError ('Expected a collection object for location, got '
3330 '{!r}' .format (location ))
34-
3531 if len (location ) != 2 :
3632 raise ValueError ('Expected two values for location [lat, lon], '
3733 'got {}' .format (len (location )))
34+ if _isnan (location ):
35+ raise ValueError ('Location values cannot contain NaNs, '
36+ 'got {!r}' .format (location ))
37+
3838 location = _iter_tolist (location )
3939 return location
4040
@@ -58,7 +58,7 @@ def _iter_tolist(x):
5858
5959def _flatten (container ):
6060 for i in container :
61- if isinstance (i , ( list , tuple , np . ndarray ) ):
61+ if isinstance (i , collections . abc . Collection ):
6262 for j in _flatten (i ):
6363 yield j
6464 else :
You can’t perform that action at this time.
0 commit comments