45#if PY_MAJOR_VERSION == 2
66#if PY_MAJOR_VERSION == 2
67 py::object capsule(py::handle<>(PyCObject_FromVoidPtr(
70 py::object capsule(py::handle<>(
75 py::incref(np::from_data(entry.
GetValue().data(),
76 np::dtype::get_builtin<NekDouble>(),
77 py::make_tuple(entry.
GetValue().size()),
78 py::make_tuple(
sizeof(
NekDouble)), capsule)
90 py::type_id<VarCoeffEntry>());
96 py::object obj((py::handle<>(py::borrowed(objPtr))));
97 np::ndarray array = py::extract<np::ndarray>(obj);
100 np::dtype dtype = np::dtype::get_builtin<
101 typename boost::remove_const<NekDouble>::type>();
102 if (dtype != array.get_dtype())
108 if (array.get_nd() != 1)
113 catch (boost::python::error_already_set &)
115 py::handle_exception();
125 if (!Py_IsInitialized())
134 py::decref((PyObject *)objPtr);
138 py::converter::rvalue_from_python_stage1_data *data)
142 py::object obj((py::handle<>(py::borrowed(objPtr))));
146 ((py::converter::rvalue_from_python_storage<VarCoeffEntry> *)data)
148 data->convertible = storage;
158 py::to_python_converter<VarCoeffEntry, VarCoeffEntryToPython>();
void CapsuleDestructor(PyObject *ptr)
void export_VarCoeffEntry()
Representation of a variable coefficient.
const Array< OneD, const NekDouble > & GetValue() const
Returns a const reference to the coefficients.
static void * convertible(PyObject *objPtr)
static void construct(PyObject *objPtr, py::converter::rvalue_from_python_stage1_data *data)
static void decrement(void *objPtr)
static PyObject * convert(VarCoeffEntry const &entry)