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

Unhandled keywords in plot3d #18245

Open
kcrisman opened this issue Apr 18, 2015 · 1 comment
Open

Unhandled keywords in plot3d #18245

kcrisman opened this issue Apr 18, 2015 · 1 comment

Comments

@kcrisman
Copy link
Member

See the discussion at #18238 - there are several options for dealing with things like

sage: show(sphere(), heyheyhey=35) # works, should it?
  • Do checking in show
  • Do checking in viewers
  • Do no checking

Anyway, this ticket is about resolving this issue, which has been around since at least 6.4.1 and probably much longer.

CC: @egourgoulhon

Component: graphics

Issue created by migration from https://trac.sagemath.org/ticket/18245

@kcrisman kcrisman added this to the sage-6.7 milestone Apr 18, 2015
@vbraun
Copy link
Member

vbraun commented Apr 18, 2015

comment:1

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'

@mkoeppe mkoeppe removed this from the sage-6.7 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants