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
Fix LaTeX error due to labels that become empty in simplify_labels #9991
Conversation
Thanks, @lpsinger ! Any chance we can add a test for this use case too? |
I added a unit test, but it is failing with this error message:
Are there any CI jobs that run in an environment with LaTeX installed? Is there already a decorator or a pytest mark that I can use to skip this test if LaTeX is not installed? |
Hmm. Not that I know of. You can try using |
I am using https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/tests/test_usetex.py#L11-L12 |
Might need to skip it regardless if matplotlib version is too old. The job with Matplotlib 2.1.2 is failing. FYI. |
Done. |
Now it's failing with:
I've no idea why, since it is not having a problem with |
c17581c
to
045ec8f
Compare
I don't think that it's even respecting |
I wonder if it is incompatible with |
Hello @lpsinger 👋! It looks like you've made some changes in your pull request, so I've checked the code again for style. There are no PEP8 style issues with this pull request - thanks! 🎉 Comment last updated at 2020-03-19 20:55:04 UTC |
This comment has been minimized.
This comment has been minimized.
Not at all. Please go ahead. |
Failures are unrelated but we're also blocked by #10039 |
@@ -93,6 +93,8 @@ def simplify_labels(self): | |||
self.text[axis][i] = self.text[axis][i][start:] | |||
if starts_dollar: | |||
self.text[axis][i] = '$' + self.text[axis][i] | |||
if self.text[axis][i] == '$$': |
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.
This is an empty maths block right i.e. $...$
where there is nothing in between, as opposed to the LaTeX for display maths?
Could you add a comment about this just to make it more obvious when reading it?
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.
Done.
@pllim, you're right, |
This allows it to be composed with pytest marks (e.g. `pytest.mark.skipif`). See astropy#9991.
This allows it to be composed with pytest marks (e.g. `pytest.mark.skipif`). See astropy#9991.
@lpsinger - since your other PR has been merged, could you rebase this and use the new fixture here? Thanks! |
Done. |
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.
Thanks!
Thank you @lpsinger! |
Fix LaTeX error due to labels that become empty in simplify_labels
Fix LaTeX error due to labels that become empty in simplify_labels
Fixes #8004.