Skip to content

REF: simplify latex formatting #35872

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 23 commits into from
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
280da38
Refactor to_latex using polymorphism
ivanovmg Aug 23, 2020
104f968
Move strcols from property to attr for performance
ivanovmg Aug 24, 2020
18bc3bf
Separate row format from LatexFormatting
ivanovmg Aug 24, 2020
83fae7d
Use property for table components
ivanovmg Aug 24, 2020
286f600
Enable builder pattern for various types of tables
ivanovmg Aug 24, 2020
f601598
Fix linting
ivanovmg Aug 24, 2020
3d5d658
REF: simplify logic in _caption_and_label
ivanovmg Aug 24, 2020
7e18adc
Add docstrings
ivanovmg Aug 25, 2020
d200c70
Add type hints to RowStringConverter
ivanovmg Aug 26, 2020
47416cf
Move tests from test_latex to test_to_latex
ivanovmg Aug 26, 2020
2aa05cc
Rename _ilevels, _nlevels, _clevels as reviewed
ivanovmg Aug 27, 2020
b06846c
Move static methods to module level funcs
ivanovmg Aug 27, 2020
a753ed5
Add test for incorrect column_format
ivanovmg Aug 27, 2020
84b29ad
Add type annotations
ivanovmg Aug 27, 2020
c9dd27e
Remove unnecessary list call
ivanovmg Aug 27, 2020
bbcd930
Drop comment
ivanovmg Aug 27, 2020
115ed84
Set more descriptive _xlevels names
ivanovmg Aug 27, 2020
8e3c729
Ignore two problematic type checks
ivanovmg Aug 27, 2020
1892b15
REF: rename product property to get_result()
ivanovmg Sep 6, 2020
3e6a829
REF: rename base builder, add doctests
ivanovmg Sep 6, 2020
d1b2acb
Merge branch 'master' into refactor/to_latex
ivanovmg Sep 6, 2020
94d8dc7
TYP: ignore specific mypy errors
ivanovmg Sep 6, 2020
c4da0a2
FIX: long line with type ignore
ivanovmg Sep 6, 2020
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
7 changes: 4 additions & 3 deletions pandas/io/formats/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,17 +938,18 @@ def to_latex(
"""
from pandas.io.formats.latex import LatexFormatter

return LatexFormatter(
latex_formatter = LatexFormatter(
self,
column_format=column_format,
longtable=longtable,
column_format=column_format,
multicolumn=multicolumn,
multicolumn_format=multicolumn_format,
multirow=multirow,
caption=caption,
label=label,
position=position,
).get_result(buf=buf, encoding=encoding)
)
return latex_formatter.get_result(buf=buf, encoding=encoding)

def _format_col(self, i: int) -> List[str]:
frame = self.tr_frame
Expand Down
Loading