-
Notifications
You must be signed in to change notification settings - Fork 3
/
xdressrc.py
64 lines (55 loc) · 2.16 KB
/
xdressrc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import pyne
from xdress.typesystem import TypeSystem
package = 'bright'
sourcedir = 'cpp'
packagedir = 'bright'
includes = [pyne.includes]
extra_types = 'pyne.extra_types' # non-default value
make_extra_types = False
stlcontainers = []
make_stlcontainers = False
stlcontainers_module = 'pyne.stlcontainers'
classes = [
# classname, source filename[, bindings filename]
('FCComp', 'fccomp'),
('EnrichmentParameters', 'enrichment_parameters'),
('Enrichment', 'bright_enrichment', 'enrichment'),
('Reprocess', 'reprocess'),
('decay_nuc', 'storage'),
('from_nuc_struct', 'storage', None),
('Storage', 'storage'),
('FluencePoint', 'fluence_point'),
('ReactorParameters', 'reactor_parameters'),
('Reactor1G', 'reactor1g'),
('LightWaterReactor1G', 'light_water_reactor1g'),
('FastReactor1G', 'fast_reactor1g'),
('FuelFabrication', 'fuel_fabrication'),
('ReactorMG', 'reactormg'),
]
functions = []
ts = TypeSystem.empty()
# hack in some material registrations
ts.register_class('Material',
cython_c_type='cpp_material.Material', cython_cimport=('pyne', 'cpp_material'),
cython_cy_type='material._Material', cython_py_type='material.Material',
cython_template_class_name='Material', cython_cyimport=('pyne', 'material'),
cython_pyimport=('pyne', 'material'),
cython_c2py=('{pytype}({var})',
('{proxy_name} = {pytype}()\n'
'{proxy_name}.mat_pointer[0] = {var}'),
('if {cache_name} is None:\n'
' {proxy_name} = {pytype}(free_mat=False)\n'
' {proxy_name}.mat_pointer = &{var}\n'
' {cache_name} = {proxy_name}\n')),
cython_py2c=(
'{proxy_name} = {pytype}({var}, free_mat=not isinstance({var}, {cytype}))',
'{proxy_name}.mat_pointer[0]'),
)
#ts.register_specialization(('map', 'str', ('Material', '*'), 0),
# cython_c_type='material._MapStrMaterial',
# cython_cy_type='material._MapStrMaterial',
# cython_py_type='material.MapStrMaterial',
# cython_cimport=(('pyne', 'material'),),
# cython_cyimport=(('pyne', 'material'),),
# cython_pyimport=(('pyne', 'material'),),
# )