Skip to content

Escape more special characters in "as_latex_tabular()" function - #2868

Closed
tvanessa wants to merge 6 commits into
statsmodels:masterfrom
tvanessa:master
Closed

tvanessa wants to merge 6 commits into
statsmodels:masterfrom
tvanessa:master

Conversation

@tvanessa

Copy link
Copy Markdown
Contributor

Solve issue #2862 .
Update list "replacements" in table.py and a unit test in test_table.py.

Comment thread statsmodels/iolib/tests/test_table.py Outdated
test1c_stubs = ('> stub1 %', 'stub_2')
test1c_header = ('#header 1$', 'header&2 |')
tbl_c = SimpleTable(table1c_data, test1c_header, test1c_stubs, ltx_fmt=ltx_fmt1)
def test_ltx_special_chars(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong indentation, unit tests on TravisCI fail
if this is because of tabs:
please use only spaces, no TABs in the code.
use editor setting where tab key adds 4 spaces

@josef-pkt

Copy link
Copy Markdown
Member

@tvanessa Thanks, looks good except for the indentation error on TravisCI

@tvanessa

Copy link
Copy Markdown
Contributor Author

I will check and fix the problem. Thanks.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.003%) to 85.381% when pulling b02d831 on tvanessa:master into eed4ae5 on statsmodels:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.003%) to 85.381% when pulling 86a7513 on tvanessa:master into eed4ae5 on statsmodels:master.

@bashtage

Copy link
Copy Markdown
Member

@josef-pkt Looks good for merge

empty='',
missing='--',
replacements={"%" : "\%", ">" : "$>$", "|" : "$|$"}
#replacements will be processed in lexicographical order

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tvanessa just to understand this
Is there a reason for processing in lexicographical order, and to add sorting?
or is it just to make it independent of how the list is filled?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you added sorting to fix a unit test failure. Do you know what the problem was if the replacement sequence is arbitrary?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ has to be replaced first I would expect, else you end up replacing inserted $'s.

@josef-pkt

Copy link
Copy Markdown
Member

It looks like the middle 4 commits could be squashed, so we have 3 commits. The last commit looks informative because of the sorting, even though I haven't tried to figure out what was wrong.

@tvanessa do you know how to rebase?

changes itself look good to me and ready to merge

@josef-pkt josef-pkt added this to the 0.8 milestone Jun 4, 2016
bashtage added a commit to bashtage/statsmodels that referenced this pull request Jun 13, 2016
@josef-pkt

Copy link
Copy Markdown
Member

merged rebased version #3015

@tvanessa Thanks for the PR and improvements
@bashtage Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants