summaryrefslogtreecommitdiff
path: root/weave/standard_array_spec.py
diff options
context:
space:
mode:
authorEric Jones <eric@enthought.com>2002-02-14 21:22:22 +0000
committerEric Jones <eric@enthought.com>2002-02-14 21:22:22 +0000
commit635ec7216d6c5c52b966a080054067577aee3882 (patch)
treef2f4098c17324ff782dd426188cb6062af8d8db2 /weave/standard_array_spec.py
parent3e4586635bf5443887c4b781d4aa0a3cfc4a2a0a (diff)
downloadnumpy-635ec7216d6c5c52b966a080054067577aee3882.tar.gz
major refactoring -- renamed _specification classes to _converter. Moved all conversion lists to the converters.py module
Diffstat (limited to 'weave/standard_array_spec.py')
-rw-r--r--weave/standard_array_spec.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/weave/standard_array_spec.py b/weave/standard_array_spec.py
index 6d104f12c..745653505 100644
--- a/weave/standard_array_spec.py
+++ b/weave/standard_array_spec.py
@@ -1,11 +1,11 @@
-from base_spec import base_specification
-from scalar_spec import numeric_to_blitz_type_mapping
+from base_spec import base_converter
+from scalar_spec import numeric_to_c_type_mapping
from Numeric import *
from types import *
import os
import standard_array_info
-class array_specification(base_specification):
+class array_converter(base_converter):
_build_information = [standard_array_info.array_info()]
def type_match(self,value):
@@ -13,7 +13,7 @@ class array_specification(base_specification):
def type_spec(self,name,value):
# factory
- new_spec = array_specification()
+ new_spec = array_converter()
new_spec.name = name
new_spec.numeric_type = value.typecode()
# dims not used, but here for compatibility with blitz_spec
@@ -28,7 +28,7 @@ class array_specification(base_specification):
return code
def inline_decl_code(self):
- type = numeric_to_blitz_type_mapping[self.numeric_type]
+ type = numeric_to_c_type_mapping[self.numeric_type]
name = self.name
var_name = self.retrieve_py_variable(inline=1)
templ = '// %(name)s array declaration\n' \
@@ -42,7 +42,7 @@ class array_specification(base_specification):
return code
def standard_decl_code(self):
- type = numeric_to_blitz_type_mapping[self.numeric_type]
+ type = numeric_to_c_type_mapping[self.numeric_type]
name = self.name
templ = '// %(name)s array declaration\n' \
'PyArrayObject* %(name)s = convert_to_numpy(py_%(name)s,"%(name)s");\n' \
@@ -58,7 +58,7 @@ class array_specification(base_specification):
# be redone in the c function.
# """
# templ_dict = {}
- # templ_dict['type'] = numeric_to_blitz_type_mapping[self.numeric_type]
+ # templ_dict['type'] = numeric_to_c_type_mapping[self.numeric_type]
# templ_dict['dims'] = self.dims
# templ_dict['name'] = self.name
# code = 'blitz::Array<%(type)s,%(dims)d> &%(name)s' % templ_dict
@@ -86,9 +86,6 @@ class array_specification(base_specification):
cmp(self.dims, other.dims) or \
cmp(self.__class__, other.__class__)
-import ext_tools
-standard_array_factories = [array_specification()] + ext_tools.default_type_factories
-
def test():
from scipy_test import module_test
module_test(__name__,__file__)