@@ -30,7 +30,9 @@ def _getBoundsZoomLevel(lon_min, lon_max, lat_min, lat_max, mapDim):
3030 Source: https://stackoverflow.com/questions/6048975/google-maps-v3-how-to-calculate-the-zoom-level-for-a-given-bounds
3131 """
3232
33- scale = 2 # adjustment to reflect MapBox base tiles are 512x512 vs. Google's 256x256
33+ scale = (
34+ 2 # adjustment to reflect MapBox base tiles are 512x512 vs. Google's 256x256
35+ )
3436 WORLD_DIM = {"height" : 256 * scale , "width" : 256 * scale }
3537 ZOOM_MAX = 18
3638
@@ -293,11 +295,7 @@ def _compute_wgs84_hexbin(
293295 {"x1" : centers [:, 0 ], "x2" : centers [:, 1 ]},
294296 native_namespace = native_namespace ,
295297 )
296- .select (
297- hexagons_ids = nw .concat_str (
298- [nw .col ("x1" ), nw .col ("x2" )], separator = ","
299- )
300- )
298+ .select (hexagons_ids = nw .concat_str ([nw .col ("x1" ), nw .col ("x2" )], separator = "," ))
301299 .get_column ("hexagons_ids" )
302300 )
303301
@@ -425,9 +423,7 @@ def create_hexbin_map(
425423 lon = df .get_column (args ["lon" ]).to_numpy (),
426424 lat_range = lat_range ,
427425 lon_range = lon_range ,
428- color = df .get_column (args ["color" ]).to_numpy ()
429- if args ["color" ]
430- else None ,
426+ color = df .get_column (args ["color" ]).to_numpy () if args ["color" ] else None ,
431427 nx = nx_hexagon ,
432428 agg_func = agg_func ,
433429 min_count = min_count ,
@@ -444,9 +440,9 @@ def create_hexbin_map(
444440 )
445441 )
446442
447- agg_data_frame = nw .concat (
448- agg_data_frame_list , how = "vertical"
449- ). with_columns ( color = nw . col ( "color" ). cast ( nw . Int64 ))
443+ agg_data_frame = nw .concat (agg_data_frame_list , how = "vertical" ). with_columns (
444+ color = nw . col ( "color" ). cast ( nw . Int64 )
445+ )
450446
451447 if range_color is None :
452448 range_color = [
@@ -460,9 +456,7 @@ def create_hexbin_map(
460456 locations = "locations" ,
461457 color = "color" ,
462458 hover_data = {"color" : True , "locations" : False , "frame" : False },
463- animation_frame = (
464- "frame" if args ["animation_frame" ] is not None else None
465- ),
459+ animation_frame = ("frame" if args ["animation_frame" ] is not None else None ),
466460 color_discrete_sequence = color_discrete_sequence ,
467461 color_discrete_map = color_discrete_map ,
468462 labels = labels ,
0 commit comments