Commit 5ac5b7d2 authored by Romain Casati's avatar Romain Casati
Browse files

Pandas + Folium display simplification.

parent e6430096
......@@ -96,8 +96,7 @@ def hack_folium():
"""
Render map to html.
"""
kernel.display_event({"display_type": "html",
"content": self._repr_html_()})
kernel.display(self)
Map.display = display
......@@ -112,8 +111,7 @@ def hack_pandas():
"""
Render data frame to html.
"""
kernel.display_event({"display_type": "html",
"content": self._repr_html_()})
kernel.display(self)
DataFrame.display = display
......
......@@ -85,8 +85,8 @@ def test_folium(selenium):
m.display()
""")
assert result['stderr'] == ""
assert result['display']['display_type'] == 'html'
map = re.sub('map_[0-9a-f]+', 'map_', result['display']['content'])
assert result['display']['display_type'] == 'multiple'
map = re.sub('map_[0-9a-f]+', 'map_', result['display']['content']['text/html'])
map = re.sub('tile_layer_[0-9a-f]+', 'tile_layer_', map)
with open(_test_data / "folium.html") as f:
target = f.read()
......@@ -105,9 +105,9 @@ def test_pandas(selenium):
df.display()
""")
assert result['stderr'] == ""
assert result['display']['display_type'] == 'html'
assert result['display']['display_type'] == 'multiple'
with open(_test_data / "pandas.html") as f:
assert result['display']['content'] == f.read()
assert result['display']['content']['text/html'] == f.read()
def test_sympy(selenium):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment