#12904: colors from rainbow don't work in 3d plots
----------------------------------+-----------------------------------------
Reporter: kcrisman | Owner: jason, was
Type: defect | Status: needs_review
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 aapitzsch):
* status: needs_work => needs_review
Comment:
Replying to [comment:2 kcrisman]:
> 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.
What do you mean by ''new formatting''?
{{{has_key}}} is deprecated, see
[http://docs.python.org/library/stdtypes.html?highlight=has_key#dict.has_key
docs.python], that's why I replaced it.
BTW, I got
{{{
sage: timeit('colors.has_key("blue")')
625 loops, best of 3: 186 ns per loop
sage: timeit('"blue" in colors')
625 loops, best of 3: 187 ns per loop
}}}
>
> 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]
> }}}
You have to apply the patch for #11383 first, see dependencies.
I'm setting this back to needs review because of the reasons mentioned
above.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12904#comment:3>
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.