@@ -15,7 +15,7 @@ def test_oms_js_inclusion():
1515 Test that the OverlappingMarkerSpiderfier JavaScript library is included in the map.
1616 """
1717 m = Map ([45.05 , 3.05 ], zoom_start = 14 )
18- oms = OverlappingMarkerSpiderfier ().add_to (m )
18+ OverlappingMarkerSpiderfier ().add_to (m )
1919
2020 rendered_map = m ._parent .render ()
2121 assert (
@@ -38,16 +38,22 @@ def test_marker_addition():
3838 ).T
3939
4040 m = Map ([45.05 , 3.05 ], zoom_start = 14 )
41- markers = [Marker (location = loc , popup = f"Marker {
42- i } " ) for i , loc in enumerate (data )]
41+ markers = [
42+ Marker (
43+ location = loc ,
44+ popup = f"Marker {
45+ i } " ,
46+ )
47+ for i , loc in enumerate (data )
48+ ]
4349
4450 for marker in markers :
4551 marker .add_to (m )
4652
47- assert len (m ._children ) == len (markers ) + 1 , (
48- f"Expected { len (markers )} markers on the map, but found {
53+ assert (
54+ len (m ._children ) == len (markers ) + 1
55+ ), f"Expected { len (markers )} markers on the map, but found {
4956 len (m ._children ) - 1 } ."
50- )
5157
5258
5359def test_map_bounds ():
@@ -64,8 +70,14 @@ def test_map_bounds():
6470 ).T
6571
6672 m = Map ([45.05 , 3.05 ], zoom_start = 14 )
67- markers = [Marker (location = loc , popup = f"Marker {
68- i } " ) for i , loc in enumerate (data )]
73+ markers = [
74+ Marker (
75+ location = loc ,
76+ popup = f"Marker {
77+ i } " ,
78+ )
79+ for i , loc in enumerate (data )
80+ ]
6981
7082 for marker in markers :
7183 marker .add_to (m )
@@ -76,10 +88,18 @@ def test_map_bounds():
7688 min_lat , min_lon = data .min (axis = 0 )
7789 max_lat , max_lon = data .max (axis = 0 )
7890
79- assert bounds [0 ][0 ] <= min_lat , "Map bounds do not correctly include the minimum latitude."
80- assert bounds [0 ][1 ] <= min_lon , "Map bounds do not correctly include the minimum longitude."
81- assert bounds [1 ][0 ] >= max_lat , "Map bounds do not correctly include the maximum latitude."
82- assert bounds [1 ][1 ] >= max_lon , "Map bounds do not correctly include the maximum longitude."
91+ assert (
92+ bounds [0 ][0 ] <= min_lat
93+ ), "Map bounds do not correctly include the minimum latitude."
94+ assert (
95+ bounds [0 ][1 ] <= min_lon
96+ ), "Map bounds do not correctly include the minimum longitude."
97+ assert (
98+ bounds [1 ][0 ] >= max_lat
99+ ), "Map bounds do not correctly include the maximum latitude."
100+ assert (
101+ bounds [1 ][1 ] >= max_lon
102+ ), "Map bounds do not correctly include the maximum longitude."
83103
84104
85105def test_overlapping_marker_spiderfier_integration ():
@@ -88,9 +108,10 @@ def test_overlapping_marker_spiderfier_integration():
88108 """
89109 m = Map ([45.05 , 3.05 ], zoom_start = 14 )
90110 oms = OverlappingMarkerSpiderfier (
91- options = {"keepSpiderfied" : True , "nearbyDistance" : 20 })
111+ options = {"keepSpiderfied" : True , "nearbyDistance" : 20 }
112+ )
92113 oms .add_to (m )
93114
94- assert oms . get_name () in m . _children , (
95- f"OverlappingMarkerSpiderfier is not correctly added to the map."
96- )
115+ assert (
116+ oms . get_name () in m . _children
117+ ), "OverlappingMarkerSpiderfier is not correctly added to the map."
0 commit comments