#12904: colors from rainbow don't work in 3d plots
----------------------------------+-----------------------------------------
Reporter: kcrisman | Owner: jason, was
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.1
Component: graphics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Karl-Dieter Crisman
Authors: André Apitzsch | Merged in:
Dependencies: #11383 | Stopgaps:
----------------------------------+-----------------------------------------
Changes (by kcrisman):
* status: needs_review => needs_work
* reviewer: => Karl-Dieter Crisman
Comment:
This is great diagnosis and a nice terse doctest. I've looked through
this a fair amount and the only obvious problem (other than the doctest
failure below) I can find is that
{{{
sage: timeit('colors.has_key("blue")')
625 loops, best of 3: 205 ns per loop
sage: timeit('"blue" in colors')
625 loops, best of 3: 230 ns per loop
}}}
and more or less this is true all the time. I don't know if there is any
documentation on which is uniformly faster? In some sense the second
seems more "Pythonic" but OO syntax is nice too...
I also wonder why the switch to the new Python error raising but not the
new formatting :) but that is really totally unimportant.
But did you run tests?
{{{
sage -t "devel/sage-main/sage/plot/plot3d/texture.py"
**********************************************************************
File "/Users/.../sage-5.0.beta14/devel/sage-
main/sage/plot/plot3d/texture.py", line 19:
sage: [t for t in G.texture_set() if t.color == colors.red] # we
should have two red textures
Expected:
[Texture(texture..., red, ff0000), Texture(texture..., red, ff0000)]
Got:
[]
**********************************************************************
File "/Users/.../sage-5.0.beta14/devel/sage-
main/sage/plot/plot3d/texture.py", line 21:
sage: [t for t in G.texture_set() if t.color == colors.yellow] #
...and one yellow
Expected:
[Texture(texture..., yellow, ffff00)]
Got:
[]
**********************************************************************
1 items had failures:
2 of 11 in __main__.example_0
***Test Failed*** 2 failures.
For whitespace errors, see the file /Users/karl-
dietercrisman/.sage//tmp/texture_43616.py
[10.8 s]
}}}
I have a feeling that this is also indicative:
{{{
sage: colors['blue']
RGB color (0.0, 0.0, 1.0)
sage: Color('blue')
RGB color (0.0, 0.0, 1.0)
sage: type(colors['blue'])
<class 'sage.plot.colors.Color'>
sage: type(Color('blue'))
<class 'sage.plot.colors.Color'>
sage: colors['blue'] == Color('blue')
False
}}}
Anyway, I'm a little surprised because `colors` has a constructor from
`Color`... but needs work.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12904#comment:2>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.