You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
error checking should be performed as early as possible (here: non-ASCII str's in e.g. ylabel()) #2560
When using set_ylabel('Täst') in the ipython notebook, there will not be any plot, but also no error message visible. The real problem is that the notebook does not show exceptions that happen in draw(), but also in the console ipython, an exception raised by set_ylabel() itself would be rendered much better than the one coming asynchroneously from draw().
If possible, an exception like this one:
File "/usr/lib/pymodules/python2.7/matplotlib/cbook.py", line 1797, in is_math_text
"matplotlib display text must have all code points < 128 or use "
ValueError: matplotlib display text must have all code points < 128 or use Unicode strings
should already be raised in the Text() constructor (or whereever appropriate).
I considered that interpretation, too, but properties would just be a syntactic change, no? I mean - the same check could be in the setter today?!
If you want to introduce something like traits, that'd be something different, but MEP13 did not seem to discuss traits, but just the leaving-out-the-parentheses part?
That's true -- I just meant to link this issue as one of many that we have that would benefit from more consistent use of setters/properties/traits. You're right that the underlying technology barely matters -- it's a matter of checking in a single place as early as possible.
Activity
hmeine commentedon Oct 30, 2013
ipython/ipython#3922 is related, but I would like to see this tackled in MPL, too.
mdboom commentedon Oct 30, 2013
MEP13 is related to this.
hmeine commentedon Oct 30, 2013
MEP13 is about using properties; I guess you meant MEP14 ("… improving the text handling …"):
https://github.com/matplotlib/matplotlib/wiki/Mep14
mdboom commentedon Oct 30, 2013
Nope -- by using properties as in MEP13, we will be performing error checking of values much earlier than we are now.
hmeine commentedon Oct 30, 2013
I considered that interpretation, too, but properties would just be a syntactic change, no? I mean - the same check could be in the setter today?!
If you want to introduce something like traits, that'd be something different, but MEP13 did not seem to discuss traits, but just the leaving-out-the-parentheses part?
mdboom commentedon Oct 30, 2013
That's true -- I just meant to link this issue as one of many that we have that would benefit from more consistent use of setters/properties/traits. You're right that the underlying technology barely matters -- it's a matter of checking in a single place as early as possible.
petehuang commentedon Jan 6, 2017
What's the exact action for MPL for this issue?
WeatherGod commentedon Jan 6, 2017
petehuang commentedon Jan 6, 2017
For visitor reference, traitlets discussion/work sitting in #4762.
Guess we can leave this open (...ugh) but need to remember to come back to this once traitlets work is complete
anntzer commentedon Aug 31, 2017
set_ylabel raises an exception now
so closing (unless I'm mistaken?). The traitlets work is tracked in a number of other issues.