Skip to content

Commit f70abac

Browse files
committed
fix formatting
1 parent f5098d6 commit f70abac

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

folium/features.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,9 +1064,10 @@ def __init__(self, geo_data, data=None, columns=None, key_on=None, # noqa
10641064
if hasattr(data, 'to_dict'):
10651065
# This is a pd.Dataframe or pd.Series
10661066
# check for numbers in future color_data keys
1067-
future_keys = data[columns[0]] if columns is not None else data.index
1068-
any_numeric_key = any([isinstance(e, (int, float, np.floating, np.integer))
1069-
for e in future_keys])
1067+
future_keys = data[columns[0]] if columns is not None else data.index # noqa
1068+
any_numeric_key = any([isinstance(e,
1069+
(int, float, np.floating, np.integer))
1070+
for e in future_keys])
10701071

10711072
if hasattr(data, 'set_index'):
10721073
# This is a pd.DataFrame

tests/test_folium.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,16 @@ def test_choropleth_geopandas_numeric(self):
255255
"""Test to make sure that Choropleth function does complete the lookup
256256
between a GeoJSON generated from a GeoDataFrame and data from the GeoDataFrame itself.
257257
258-
key_on field is dtype = str, while column 0 is dtype = int
258+
key_on field is dtype = str, while column 0 is dtype = int
259259
All geometries have matching values (no nan_fill_color allowed)
260260
"""
261261
self.setup()
262262

263263
with open(os.path.join(rootpath, 'geo_grid.json')) as f:
264264
geo_data = json.load(f)
265-
265+
266266
geo_data_frame = gpd.GeoDataFrame.from_features(geo_data['features'])
267-
geo_data_frame.crs = {'init':'epsg:4326'}
267+
geo_data_frame.crs = {'init': 'epsg:4326'}
268268
fill_color = 'BuPu'
269269
key_on = 'feature.id'
270270

@@ -294,9 +294,9 @@ def test_choropleth_geopandas_mixed(self):
294294

295295
with open(os.path.join(rootpath, 'geo_grid.json')) as f:
296296
geo_data = json.load(f)
297-
297+
298298
geo_data_frame = gpd.GeoDataFrame.from_features(geo_data['features'])
299-
geo_data_frame.crs = {'init':'epsg:4326'}
299+
geo_data_frame.crs = {'init': 'epsg:4326'}
300300
data = pd.DataFrame({'idx': {'0': 0, '1': '1', '2': 2, '3': 3, '4': 4, '5': 5},
301301
'value': {'0': 78.0, '1': 39.0, '2': 0.0, '3': 81.0, '4': 42.0, '5': 68.0}})
302302
fill_color = 'BuPu'
@@ -330,9 +330,9 @@ def test_choropleth_geopandas_str(self):
330330

331331
with open(os.path.join(rootpath, 'geo_grid.json')) as f:
332332
geo_data = json.load(f)
333-
333+
334334
geo_data_frame = gpd.GeoDataFrame.from_features(geo_data['features'])
335-
geo_data_frame.crs = {'init':'epsg:4326'}
335+
geo_data_frame.crs = {'init': 'epsg:4326'}
336336
data = pd.DataFrame({'idx': {'0': '0', '1': '1', '2': '2', '3': '3', '4': '4', '5': '5'},
337337
'value': {'0': 78.0, '1': 39.0, '2': 0.0, '3': 81.0, '4': 42.0, '5': 68.0}})
338338
fill_color = 'BuPu'

0 commit comments

Comments
 (0)