Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
fix for latex call on PS backend (Issue #5895) #5928
Conversation
mdboom
added the
needs_review
label
Jan 27, 2016
janschulz
commented on an outdated diff
Jan 27, 2016
| @@ -1467,6 +1467,7 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, custom_preamble, | ||
| command = '%s cd "%s" && dvips -q -R0 -o "%s" "%s" > "%s"'%(precmd, tmpdir, | ||
| os.path.split(psfile)[-1], os.path.split(dvifile)[-1], outfile) | ||
| + command=command.replace("~","\\string~") |
janschulz
Contributor
|
|
I think I added a new commit instead of amending the old one :/ |
|
That ok, you can "squash" it! On Wed, Jan 27, 2016 at 3:36 PM, Grillard notifications@github.com wrote:
|
|
I think I am a bit confused now... I was using the web editor since it was such a small change, I thought it would be enough, then I put the change in the wrong line, so I cloned the forked repository into my computer to have access to git, ( thats the merge branch I guess), tried to squash but now we have 4 commits instead of two hahaha... |
janschulz
commented on an outdated diff
Jan 27, 2016
| @@ -1454,6 +1454,8 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, custom_preamble, | ||
| else: precmd = '' | ||
| command = '%s cd "%s" && latex -interaction=nonstopmode "%s" > "%s"'\ | ||
| %(precmd, tmpdir, latexfile, outfile) | ||
| + # Replace ~ so Latex does not think it is line break | ||
| + command=command.replace("~","\\string~") |
janschulz
Contributor
|
|
ups, I think I screw up a little. I am even more confused now... Sorry! |
|
Ok, so I have a HUGE mess with the commits, not sure how to fix/clean that, I also noticed that what I had push did not work properly, I found a way to fix it properly now, and it is pushed. at least in the files modified is still clean what the changes are. I am sorry for the huge mess!! |
|
Hey, we all started with git at some time :-) I'm not sure how you got to this git history, but here are two ways to get back to a working PR: Version 1: Just close this PR and start a new one, where you only include the additons from https://github.com/Grillard/matplotlib/commit/cc4b1221ea2fdd5c07e0bc52ff55799dfc35789d :-) Version 2: on the commandline do the following commands:
No an editor is shown where each commit in your branch is shown in one line which has a For the all but the first commit, replace the
-> Save and close the editor
Save and close the editor. You can check what you produces by calling Finally, push that to your PR via |
|
uff!, that was useful thanks!. now this looks as it supposed to! I really like git!, it only get confusing sometimes! about the changes: note that I also needed to change \ for /, since latex recognize the \ as a function call! |
|
Wow, great. Let's wait if the CI tools go green on this and if so I'm +1 on merging it :-) Not sure if a test for this behaviour would be good... Maybe by setting TMP/TMPDIR/TEMP in one of the tests to a new dir with a |
QuLogic
commented on an outdated diff
Jan 28, 2016
QuLogic
commented on an outdated diff
Jan 28, 2016
| @@ -1452,6 +1452,9 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, custom_preamble, | ||
| # multiple | ||
| if sys.platform == 'win32': precmd = '%s &&'% os.path.splitdrive(tmpdir)[0] | ||
| else: precmd = '' | ||
| + # Replace ~ so Latex does not think it is line break | ||
| + latexfile=latexfile.replace("\\","/") |
|
|
|
Ok, I modified based on QuLogic feedback. (I also squashed the last commit, I am not sure if this is the standard, if not please let me know) |
|
The standards on squashing or not vary from project to project (and ever PR to PR). The pros of aggressively squashing is it keeps the project git history looking 'clean', but it puts a higher burden on occasional committers, coarse grains changes (which can make forensics harder), and makes people in the habit of regularly force pushing. |
tacaswell
added this to the
1.5.2 (Critical bug fix release)
milestone
Jan 30, 2016
tacaswell
commented on the diff
Jan 30, 2016
| @@ -1452,6 +1452,10 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, custom_preamble, | ||
| # multiple | ||
| if sys.platform == 'win32': precmd = '%s &&'% os.path.splitdrive(tmpdir)[0] | ||
| else: precmd = '' | ||
| + #Replace \\ for / so latex does not think there is a function call | ||
| + latexfile = latexfile.replace("\\", "/") |
janschulz
Contributor
|
So, it recongnizes the string, but it tried to make all |
|
Thank you both for the explanation. |
tacaswell
added a commit
that referenced
this pull request
Feb 1, 2016
|
|
tacaswell |
190c923
|
tacaswell
merged commit 190c923
into matplotlib:master
Feb 1, 2016
tacaswell
removed the
needs_review
label
Feb 1, 2016
|
@grillard Congratulations on what I think is your first (hopefully of many) contributions to mpl. |
tacaswell
added a commit
that referenced
this pull request
Feb 1, 2016
|
|
tacaswell |
ab7c982
|
|
backported to 1.5.x as ab7c982 |
|
@tacaswell IMO this should get a testcase:
This triggers the bug in an older version and not anymore in a newer one... |
|
@grillard Congratulations from me as well! :-) |
|
I do not think we have even smoke tests for the ps backend . |
|
The funny thing is there is a |
|
Oh, so we do. I should have also known that because that file is the source of many of the transient travis failures. The |
|
Many thanks @tacaswell and @janschulz . Happy to be helpful. I learned a lot about git too!. |
janschulz
added a commit
to janschulz/matplotlib
that referenced
this pull request
Feb 2, 2016
|
|
janschulz |
b74d3ab
|
janschulz
referenced
this pull request
Feb 2, 2016
Merged
TST: add a test for tilde in tempfile for the PS backend #5958
|
Test in #5958 |
janschulz
added a commit
to janschulz/matplotlib
that referenced
this pull request
Feb 2, 2016
|
|
janschulz |
df9204b
|
tacaswell
added a commit
to tacaswell/matplotlib
that referenced
this pull request
May 22, 2016
|
|
tacaswell |
92f463c
|
Grillard commentedJan 27, 2016
If the ~ character appears on the path of the file, latex might recognize it as a line break, and therefore fail. By replacing the ~ for \string~ we can avoid this.