#8479: numpy support for more basic functions
-----------------------------+----------------------------------------------
   Reporter:  whuss          |       Owner:  AlexGhitza     
       Type:  enhancement    |      Status:  positive_review
   Priority:  major          |   Milestone:  sage-4.4.2     
  Component:  symbolics      |    Keywords:  numpy          
     Author:  Wilfried Huss  |    Upstream:  N/A            
   Reviewer:  Burcin Erocal  |      Merged:                 
Work_issues:                 |  
-----------------------------+----------------------------------------------
Changes (by burcin):

  * status:  needs_review => positive_review


Comment:

 Thanks for the quick response.

 Replying to [comment:5 whuss]:
 > Replying to [comment:4 burcin]:
 >
 > > * Can we change the test in sage.functions.other.sqrt() to work
 without importing numpy?
 >
 > done in the new patch

 Thanks!

 > > * All the examples in the doctests are for functions with a single
 argument. Is there any reason to move the check in
 `sage.symbolic.function.Function.__call__()` to try all arguments?
 >
 > In the original patch I forgot to add tests for atan2, which also didn't
 work with numpy before. The tests are now included.

 Fair enough.

 > > We should also consider moving this check to
 `sage.symbolic.function.BuiltinFunction.__call__()`.
 >
 > Why would this be better?

 This code path is speed critical since it gets called thousands of times
 for many applications like plotting. Checking the type of each argument
 introduces a penalty for functions with a single argument.

 > It currently does not have a {{{__call__}}} method.

 Sorry about that. I confused it with the `__call__()` method of
 `GinacFunction`, which also checks if there is only one argument, and it
 has a method with the same name as the function. Now I wonder why isn't
 that in `BuiltinFunction`...


 Your patch was missing an empty line after line 165 in
 `sage/functions/other.py`.
 attachment:trac-8479-numpy_functions.take2.patch fixes this. Only
 attachment:trac-8479-numpy_functions.take2.patch should be applied.


 Great work!

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8479#comment:6>
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.

Reply via email to