#18245: Unhandled keywords in plot3d
----------------------------+------------------------
       Reporter:  kcrisman  |        Owner:
           Type:  task      |       Status:  new
       Priority:  major     |    Milestone:  sage-6.7
      Component:  graphics  |   Resolution:
       Keywords:            |    Merged in:
        Authors:            |    Reviewers:
Report Upstream:  N/A       |  Work issues:
         Branch:            |       Commit:
   Dependencies:            |     Stopgaps:
----------------------------+------------------------

Comment (by vbraun):

 Also, the *handled* options should have their value checked, and not just
 fail when they are in the process of being drawn on the screen.

 The right solution imoh is by introducing infrastructure for "option
 dictionaries with validation". I made a simple version for the display
 preferences, for example
 {{{
 sage: from sage.repl.rich_output.preferences import DisplayPreferences
 sage: d = DisplayPreferences(text='latex')
 sage: d
 Display preferences:
 * graphics is not specified
 * text = latex
 sage: d.text
 'latex'
 sage: d.text = 'coocoo'
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)
 <ipython-input-12-45e65af2b5e2> in <module>()
 ----> 1 d.text = 'coocoo'

 /home/vbraun/Code/sage/local/lib/python2.7/site-
 packages/sage/repl/rich_output/preferences.pyc in setter(self, prefs,
 value)
     230         if value not in allowed:
     231             raise ValueError('value must be unset (None) or one of
 {0}, got {1}'
 --> 232                              .format(allowed, value))
     233         setattr(prefs, self.underscore_name, value)
     234

 ValueError: value must be unset (None) or one of ('plain', 'ascii_art',
 'latex'), got coocoo
 sage: d.heyhey
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)
 <ipython-input-13-2956b69fb951> in <module>()
 ----> 1 d.heyhey

 AttributeError: 'DisplayPreferences' object has no attribute 'heyhey'
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/18245#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to