Repository navigation
Expand file tree
/
Copy pathInterpolationData.python.cpp
More file actions
83 lines (65 loc) · 1.78 KB
/
Copy pathInterpolationData.python.cpp
File metadata and controls
83 lines (65 loc) · 1.78 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/continuous/InterpolationData.hpp"
#include "tools/views/views-python.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
namespace continuous {
void wrapInterpolationData( python::module& module, python::module& ) {
// type aliases
using Block = njoy::ACEtk::continuous::InterpolationData;
// wrap views created by this block
// create the block
python::class_< Block > block(
module,
"InterpolationData",
"Convenience interface for interpolation data"
);
// wrap the block
block
.def_property_readonly(
"NB",
&Block::NB,
"The number of interpolation regions"
)
.def_property_readonly(
"number_interpolation_regions",
&Block::numberInterpolationRegions,
"The number of interpolation regions"
)
.def_property_readonly(
"is_linear_linear",
&Block::isLinearLinear,
"Flag to indicate whether or not the data is fully linear-linear"
)
.def_property_readonly(
"NBT",
[] ( const Block& self ) -> LongRange
{ return self.NBT(); },
"The interpolation boundaries"
)
.def_property_readonly(
"boundaries",
[] ( const Block& self ) -> LongRange
{ return self.boundaries(); },
"The interpolation boundaries"
)
.def_property_readonly(
"INT",
[] ( const Block& self ) -> LongRange
{ return self.INT(); },
"The interpolation type for each range"
)
.def_property_readonly(
"interpolants",
[] ( const Block& self ) -> LongRange
{ return self.interpolants(); },
"The interpolation type for each range"
);
// add standard block definitions
addStandardBlockDefinitions< Block >( block );
}
} // continuous namespace