Skip to content

ASV: rendering hidden elements in Styler #43687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions asv_bench/benchmarks/io/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ def peakmem_format_render(self, cols, rows):
self._style_format()
self.st._render_html(True, True)

def time_apply_format_hide_render(self, cols, rows):
self._style_apply_format_hide()
self.st._render_html(True, True)

def peakmem_apply_format_hide_render(self, cols, rows):
self._style_apply_format_hide()
self.st._render_html(True, True)

def _style_apply(self):
def _apply_func(s):
return [
Expand All @@ -63,3 +71,9 @@ def _style_format(self):
self.st = self.df.style.format(
"{:,.3f}", subset=IndexSlice["row_1":f"row_{ir}", "float_1":f"float_{ic}"]
)

def _style_apply_format_hide(self):
self.st = self.df.style.applymap(lambda v: "color: red;")
self.st.format("{:.3f}")
self.st.hide_index(self.st.index[1:])
self.st.hide_columns(self.st.columns[1:])