Attachment 'typed_array_converter.py'
Download
1 """ Modified version of array_converter that adds a type definition macro
2 for each array.
3 """
4
5 from scipy.weave.standard_array_spec import array_converter
6 from scipy.weave import c_spec
7
8
9
10
11
12 class typed_array_converter(array_converter):
13 """ Minor change to the original array type converter that adds a macro
14 for the array's data type.
15 """
16
17 def declaration_code(self, templatize = 0,inline=0):
18 code = array_converter.declaration_code(self, templatize,
19 inline)
20 res = self.template_vars(inline=inline)
21
22 code += '#define %(name)s_data_type %(num_type)s\n' % res
23
24 return code
25
26
27
28 converters = [c_spec.int_converter(),
29 c_spec.float_converter(),
30 c_spec.complex_converter(),
31 c_spec.unicode_converter(),
32 c_spec.string_converter(),
33 c_spec.list_converter(),
34 c_spec.dict_converter(),
35 c_spec.tuple_converter(),
36 c_spec.file_converter(),
37 c_spec.instance_converter(),
38 typed_array_converter()]
39
40
41
New Attachment
Attached Files
To refer to attachments on a page, use
attachment:filename, as shown below in the list of files. Do
NOT use the URL of the
[get] link, since this is subject to change and can break easily.
- [get | view] (2007-03-15 18:48:51, 16.1 KB) [[attachment:histogram.py]]
- [get | view] (2007-03-15 18:49:25, 1.5 KB) [[attachment:typed_array_converter.py]]