[SciPy-dev] cephes.tandg test

David M. Cooke cookedm at physics.mcmaster.ca
Wed Jan 11 07:44:21 CST 2006


On Jan 11, 2006, at 07:46 , Arnd Baecker wrote:

> Hi,
>
> On Wed, 11 Jan 2006, David M. Cooke wrote:
>
>> On Jan 10, 2006, at 09:35 , Arnd Baecker wrote:
> [...]
>>> DESIRED: 1.0
>>> ACTUAL: 1.0000000000000002
>>> -------------------------------------------------------------------- 
>>> --
>>>
>>> The is caused by the strict equality test:
>>>
>>>     def check_tandg(self):
>>>         assert_equal(cephes.tandg(45),1.0)
>>>
>>> Is there a reason, why one should get 1.0 up to the last bit?
>>> If not an `assert_almost_equal` might be more appropriate?
>>
>> Well, I'd argue that if you've gone to the trouble of making a
>> version of tan that takes degrees, it *should* return exact values
>> for those that it can (tan(0) = 0, tan(+-45) = +-1).
>>
>> The cephes code was weird enough that it could miss that, so I added
>> a special case test
>> http://projects.scipy.org/scipy/scipy/changeset/1545
>>
>> See if it works now.
>
> Well:
>
[snip test failures]

Oh, foo. I get those too, now that I made sure it remade the file. (I  
wish distutils did proper dependency checking!!!!!!)

> (BTW: I really don't like those "Overwriting" messages,
> and I also have reservations about steering that with an environment
> variable - but that's a different subject).

me neither...

> What can I do to find out what is going wrong with tandg
> (not that I need that function at all, but a failing unit
> test could point to something deeper ...)

Well, at the moment, these are just pointing to my messing up of  
tandg :) Since I can reproduce your failures, I'll be able to fix it.

-- 
|>|\/|<
/------------------------------------------------------------------\
|David M. Cooke              http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca




More information about the Scipy-dev mailing list