summaryrefslogtreecommitdiff
path: root/weave/standard_array_spec.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2005-09-26 19:01:50 +0000
committerTravis Oliphant <oliphant@enthought.com>2005-09-26 19:01:50 +0000
commit8ac222e304fdd59394725d27e82168a95eadaf1c (patch)
treec5cfd3f5ff09cc095c1c25620b4ff6887e77243c /weave/standard_array_spec.py
parented8548a9686b70995ff1afdefbba437d84134d08 (diff)
downloadnumpy-8ac222e304fdd59394725d27e82168a95eadaf1c.tar.gz
Adding weave and test
Diffstat (limited to 'weave/standard_array_spec.py')
-rw-r--r--weave/standard_array_spec.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/weave/standard_array_spec.py b/weave/standard_array_spec.py
index 18651ca28..261aeb3a5 100644
--- a/weave/standard_array_spec.py
+++ b/weave/standard_array_spec.py
@@ -1,18 +1,17 @@
from c_spec import common_base_converter
from c_spec import num_to_c_types
-from scipy_base.numerix import *
+from scipy.base import *
from types import *
import os
num_typecode = {}
-num_typecode['c'] = 'PyArray_CHAR'
-num_typecode['1'] = 'PyArray_SBYTE'
-num_typecode['b'] = 'PyArray_UBYTE'
-num_typecode['s'] = 'PyArray_SHORT'
-num_typecode['w'] = 'PyArray_USHORT'
+num_typecode['b'] = 'PyArray_SBYTE'
+num_typecode['B'] = 'PyArray_UBYTE'
+num_typecode['h'] = 'PyArray_SHORT'
+num_typecode['H'] = 'PyArray_USHORT'
num_typecode['i'] = 'PyArray_INT' # PyArray_INT has troubles ?? What does this note mean ??
-num_typecode['u'] = 'PyArray_UINT'
+num_typecode['I'] = 'PyArray_UINT'
num_typecode['l'] = 'PyArray_LONG'
num_typecode['f'] = 'PyArray_FLOAT'
num_typecode['d'] = 'PyArray_DOUBLE'
@@ -117,8 +116,8 @@ numeric_init_code = \
"""
Py_Initialize();
import_array();
-PyImport_ImportModule("%s");
-""" % NX_ARRAYPKG
+PyImport_ImportModule("scipy");
+"""
class array_converter(common_base_converter):
@@ -130,13 +129,13 @@ class array_converter(common_base_converter):
self.return_type = 'PyArrayObject*'
self.to_c_return = '(PyArrayObject*) py_obj'
self.matching_types = [ArrayType]
- self.headers = ['"%s/arrayobject.h"' % NX_ARRAYPKG,
+ self.headers = ['"scipy/arrayobject.h"',
'<complex>','<math.h>']
self.support_code = [size_check_code, type_check_code]
self.module_init_code = [numeric_init_code]
def get_var_type(self,value):
- return value.typecode()
+ return value.dtypechar
def template_vars(self,inline=0):
res = common_base_converter.template_vars(self,inline)