[SciPy-dev] Constants in Scipy

David Warde-Farley dwf at cs.toronto.edu
Sat Nov 28 16:13:20 EST 2009


On 28-Nov-09, at 5:50 AM, Arkapravo Bhaumik wrote:

> However, MATLAB in comparison has euler-gamma built-into it and  
> intelligently recognises the expression as it is typed in, Scipy is  
> not yet able to do so.

SciPy is a library, Matlab is an IDE. Intelligent completion is way  
outside SciPy's territory. IPython should be able to tabcomplete any  
constants that are built in, though, if you've done from scipy import  
* or something similar.

As for identifying certain "expressions" as "special integrals",  
Python's architecture makes this basically impossible using the code  
you used. Note that your Matlab example passes a string to int(),  
whereas you are passing quad a Python callable. You would have to  
rewrite quad() to take string expressions rather than arbitrary  
callable functions, which is extremely undesirable because it both  
adds unnecessary bloat to SciPy and (if the usual method were  
unavailable) restricts functionality.

> If the desire is indeed to make Scipy into a dynamic and robust  
> software then various constants must be built-into the software and  
> Scipy made to identify such expressions.


"Identifying expressions" is outside the project's scope. You could  
certainly do it with SymPy, where exp() and the like yield placeholder  
objects rather than functions, but SciPy isn't a symbolic math package.

David



More information about the SciPy-Dev mailing list