MCPcopy Create free account
hub / github.com/datapane/datapane / _ipython_display_

Method _ipython_display_

python-client/src/datapane/blocks/base.py:69–81  ·  view source on GitHub ↗

Display the block as a side effect within a Jupyter notebook

(self)

Source from the content-addressed store, hash-verified

67 self._attributes.update(mk_attribs(**kwargs))
68
69 def _ipython_display_(self):
70 """Display the block as a side effect within a Jupyter notebook"""
71 from IPython.display import HTML, display
72
73 from datapane.ipython.environment import get_environment
74 from datapane.processors.api import stringify_report
75 from datapane.view import Blocks
76
77 if get_environment().support_rich_display:
78 html_str = stringify_report(Blocks(self))
79 display(HTML(html_str))
80 else:
81 display(self.__str__())
82
83 def accept(self, visitor: VV) -> VV:
84 visitor.visit(self)

Callers

nothing calls this directly

Calls 5

__str__Method · 0.95
get_environmentFunction · 0.90
stringify_reportFunction · 0.90
BlocksClass · 0.90
HTMLClass · 0.85

Tested by

no test coverage detected