I just got a doc test failure on Solaris.

File "/export/home/drkirkby/32/sage-4.3.4.alpha0/devel/sage/sage/plot/colors.py", line 660:
    sage: gold / pi + yellow * e
Expected:
    RGB color (0.51829585732141792, 0.49333037605210095, 0.0)
Got:
    RGB color (0.51829585732141814, 0.49333037605210117, 0.0)


Looking at the doc test I see this:


--------------------------------------
       EXAMPLES::

            sage: from __future__ import division
            sage: from sage.plot.colors import yellow, gold
            sage: yellow / 4
            RGB color (0.25, 0.25, 0.0)
            sage: yellow.__truediv__(4)
            RGB color (0.25, 0.25, 0.0)
            sage: gold / pi + yellow * e
            RGB color (0.51829585732141792, 0.49333037605210095, 0.0)
----------------------------------------------

The is absolutely no justification given in the doc test for this result, so how do we know it's right?

Printing the values of 'yellow' and 'gold' I get:

sage: print yellow
RGB color (1.0, 1.0, 0.0)
sage: print gold
RGB color (1.0, 0.84313725490196079, 0.0)
sage:

I personally don't understand how one can divide one colour by another, but I'm not disputing that there can be some logic in this. I tried in Mathematica to just divide the these as lists

In[44]:= yellow={1,1,0}

Out[44]= {1, 1, 0}

In[45]:= gold={1.0,0.84313725490196079, 0.0}

In[46]:= gold/Pi + yellow E

Out[46]= {3.03659, 2.98666, 0.}

With no idea what this division is supposed to do, I tried.

In[47]:= Normalize[%]

Out[47]= {0.712944, 0.701221, 0.}

but that gives totally different numbers.

So I'm none the wiser. Of course, I could create a ticket to check the expected value to be

0.51829585732141..., 0.49333037605210...,0.0

but I'd have no justification for this.

Perhaps someone can enlighten me how one divides /multiples colours, and can show me a high precision value for the result.

This is just one of several examples I've seen in Sage where the numeric result from a doc test is not obvious. The "Expected" value is probably what someone got on their computer. I "Got" a different value on my computer. But who knows what the result should be? Without some justification, I find it hard to believe this doc test achieves very much. I've just waisted an hour trying to work out how I might reproduce this, but can't

Dave


Dave

--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to