[Numpy-discussion] scipy.base

Travis Oliphant oliphant at ee.byu.edu
Mon Apr 11 17:12:25 CDT 2005


Pearu Peterson wrote:

>Hi Travis,
>
>I have committed scipy.{distutils,base} to Numeric3 CVS repository. 
>scipy.distutils is a reviewed version of scipy_distutils and
>as one of its new features there is Configuration class that allows
>one to write much simpler setup.py files for subpackages. See setup.py
>files under Numeric3/scipy directory for examples. scipy.base is a
>very minimal copy of scipy_base plus ndarray modules.
>  
>
Thank you, thank you for your help with this.

>When using setup_scipy.py for building, the ndarray package is installed
>as scipy.base and
>
>  from scipy.base import *
>
>should work equivalently to
>
>  from ndarray import *
>
>for instance.
>  
>
I don't like from ndarray import *.   It's only been a place-holder.  
Let's get rid of it as soon as possible.

>To clean up Numeric3 CVS repository completely then Include, Src, Lib,
>CodeGenerators directories should be moved under the scipy/base directory.
>However, this step can be omitted if you would prefer working with files
>at the top directory of Numeric3. 
>
I have no preference here.   Whatever works best.

>First, how to name Numeric3 project when it installs scipy.base,
>scipy.distutils, Numeric packages, etc? This name will be used when
>creating source distributions and also as part of the path where header
>files will be installed. At the moment setup_scipy.py uses the name
>'ndarray'. 
>
I don't like the name ndarray -- it's too limiting.  Why not scipy_core? 

>In fact, 'Numeric' (with version 3x.x) would be also an option but that
>would be certainly cause some problems when one wants both Numeric 2x.x
>and Numeric 3x.x to be installed in the system, the header files would end
>up in the same directory, for instance. As a workaround, we could force
>installing Numeric3 header files to <prefix>/include/Numeric/3/ or
>something. I acctually like this idea but I wonder what other think about
>this.
>  
>
How about include/scipy?

>Second, is it already possible to use ndarray C/API as a replacement of
>Numeric C/API, i.e. would simple replacement of 
>
>  #include "Numeric/arrayobject.h"
>
>with 
>
>  #include "ndarray/arrayobject.h"
>
>work? And if not, will it ever be? This would be interesting to know as an
>extension writer.
>  
>
This should work fine.   All of the old C-API is there (there are some 
new calls, but the old ones should still work).   The only issue is that 
one of the calls (PyArray_Take I think now uses a standardized 
PyArrayObject * as one of it's arguments instead of a PyObject *).  This 
shouldn't be a problem, since you always had to call it with an array.  
It's just now more explicit, but could lead to a warning.

>[*] Due to keeping changes to Numeric3 sources minimal, scipy.base
>multiarray and umath modules first try to import ndarray and then
>scipy.base whenever ndarray is missing. One should remove ndarray
>installation from the system before using scipy.base.
>  
>
I don't mind changing the package names entirely at this point. 

-Travis







More information about the Numpy-discussion mailing list