Skip to content
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

removing sgskip #8725

Merged
merged 1 commit into from
Jun 9, 2017
Merged

removing sgskip #8725

merged 1 commit into from
Jun 9, 2017

Conversation

choldgraf
Copy link
Contributor

fingers crossed that the tests magically pass...

@anntzer
Copy link
Contributor

anntzer commented Jun 7, 2017

looks like you need to remove the coding utf8 line (but that may be considered as a s-g bug too)

(I guess you may want to see whether other files were sgskipped for the same reason)

@choldgraf
Copy link
Contributor Author

hmm - let's see if removing that line solves the problem and I can look into whether this is an issue elsewhere too

@anntzer
Copy link
Contributor

anntzer commented Jun 7, 2017

The other files that could be affected are userdemo/pgf_*.py, but they probably need to be modified a little bit: they use a noninteractive backend, even though they do ultimately generate a png file so at least in theory s-g may be able to handle them... I guess a workaround is to indeed write their output, but then add a line that reads the png and displays it using an interactive backend.

EDIT: they actually need the coding set (for py2) as they do contain unicode... but that line needs to be moved before the docstring

@choldgraf
Copy link
Contributor Author

how could I test this out on my computer? last night I tried building sphinx gallery w/ both python 2 and 3 on my machine and it worked OK, so it made things a bit hard to debug. Did you figure out how to make this error on your computer?

@anntzer
Copy link
Contributor

anntzer commented Jun 7, 2017

test what? right now python2 examples/userdemo/pgf_fonts_sgskip.py just errors out, but works with py3

@choldgraf
Copy link
Contributor Author

huh - it was working for me on python2 that's what was confusing me

@choldgraf
Copy link
Contributor Author

oops sorry, not pgf_fonts_skip, I was talking about demo_text......lemme try this one

@choldgraf
Copy link
Contributor Author

ok I reproduced the error on my end too. So I have two questions about these examples:

  1. If we move the encoding to the top line, it works, but won't that make SG error similarly to the original example in this PR?
  2. I tried adding a call to mpl.use but got errors since pyplot had already been imported with a backend. Is there a way to do switch the backend on the fly without creating an error?

@anntzer
Copy link
Contributor

anntzer commented Jun 7, 2017

  1. I think this is really a bug in s-g, they need something like add strip_encoding_cookie transformer ipython/ipython#3662.
  2. I thought you could switch between noninteractive backends, or from a noninteractive to an interactive backend? If not I dunno.

@choldgraf
Copy link
Contributor Author

@anntzer so it'd be fixed if s-g stripped the encoding line before trying to do anything? I can open an issue though it's unclear whether I've got my head wrapped around this problem totally...encoding w strings always confuses me

@anntzer
Copy link
Contributor

anntzer commented Jun 7, 2017

I think so.

@tacaswell tacaswell merged commit 95cfdeb into matplotlib:master Jun 9, 2017
@QuLogic QuLogic added this to the 2.1 (next point release) milestone Aug 7, 2017
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.

None yet

5 participants