-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: create core Styler rendering functions and subclass conditional styling applications #40745
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
CLN: create core Styler rendering functions and subclass conditional styling applications #40745
Conversation
clabels = [[x] for x in clabels] | ||
clabels = list(zip(*clabels)) | ||
|
||
head = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would make this a composite method that calls: _translate_head, _translate_body, _translate_footer, but can do in followons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes is a good idea: but i'm trying hard to adopt your former advice of targeted smaller PRs! :)
(this is also why i submitted that other small PR yesterday because this is ultimately the idea)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a good idea. its totally ok to take my suggestions as followons. would rather merge things that are partial to make the workflow easier.
pandas/io/formats/style_render.py
Outdated
|
||
return self | ||
|
||
def _repr_html_(self) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't these 2 methods be in the subclasses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arguably yes. they weren't, and then I put them in last. no strong opinion, so i'll make changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are talking about _repr_html_
and to_excel
, i assume.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
cool I think need to rebase (do this pretty much every time when you push) |
…_styler # Conflicts: # pandas/io/formats/style.py
…_styler # Conflicts: # pandas/io/formats/style.py
…_styler # Conflicts: # pandas/io/formats/style.py
@jreback this is green and ready to go if you approve. |
thanks @attack68 |
…styling applications (pandas-dev#40745)
Here is a first draft at splitting up
style.py
, ahead of adding new LaTeX functionalityKey Points
style_render.py
:style.py
maintains all the conditional application methods and the utility methods and is subclass:All methods copied, no changes made, other than deprivatizing shared method names.
Technically this now works: