Commit 186ad576 authored by Emilia Juda's avatar Emilia Juda
Browse files

added Python docstrings

parent afa86b81
......@@ -39,7 +39,15 @@ void export_Points()
{
NEKPY_WRAP_ENUM_STRING(PointsType, kPointsTypeStr);
py::class_<PointsKey>("PointsKey", py::init<const int, const PointsType&>())
py::class_<PointsKey>("PointsKey",
"Create a PointsKey which uniquely defines quadrature points.\n"
"\n"
"Args:\n"
"\tnQuadPoints (integer): The number of quadrature points.\n"
"\tpointsType (PointsType object): The type of quadrature points.\n"
"Returns:\n"
"\tPointsKey object defining quadrature points.",
py::init<const int, const PointsType&>())
.def("GetNumPoints", &PointsKey::GetNumPoints)
.def("GetPointsType", &PointsKey::GetPointsType)
......@@ -47,10 +55,12 @@ void export_Points()
.def("GetTotNumPoints", &PointsKey::GetTotNumPoints)
;
py::class_<Points<double>,
std::shared_ptr<Points<double> >,
py::class_<Points<double>,
std::shared_ptr<Points<double> >,
boost::noncopyable>(
"Points", py::no_init)
"Points",
"docstring",
py::no_init)
.def("Create", &Points_Create)
.staticmethod("Create")
......@@ -61,11 +71,41 @@ void export_Points()
.def("GetTotNumPoints", &Points<double>::GetTotNumPoints)
.def("GetZ", &Points<double>::GetZ,
py::return_value_policy<py::copy_const_reference>())
py::return_value_policy<py::copy_const_reference>(),
"Get quadrature zeros.\n"
"\n"
"Returns:\n"
"\tNumPy ndarray of length equal to the number of quadrature\n"
"\tpoints, containing quadrature zeros.")
.def("GetW", &Points<double>::GetZ,
py::return_value_policy<py::copy_const_reference>())
.def("GetZW", &Points_GetZW)
.def("GetD", &Points_GetD)
.def("GetD", &Points_GetD2)
py::return_value_policy<py::copy_const_reference>(),
"Get quadrature weights.\n"
"\n"
"Returns:\n"
"\tNumPy ndarray of length equal to the number of quadrature\n"
"\tpoints, containing quadrature weights.")
.def("GetZW", &Points_GetZW,
"Get quadrature zeros and weights.\n"
"\n"
"Returns:\n"
"\tTuple containing the quadrature zeros and quadrature weights,\n"
"\ti.e. (Points.GetZ(), Points.GetW()).")
.def("GetD", &Points_GetD,
"Get the differentiation matrix.\n"
"\n"
"Returns:\n"
"\tNumPy ndarray of n x n dimensions, where n is equal to\n"
"\tthe number of quadrature points, containing the\n"
"\tdifferentiation matrix.")
// to-do: fill in Args
.def("GetD", &Points_GetD2,
"Get the differentiation matrix.\n"
"\n"
"Args:\n"
"\t WIP\n"
"Returns:\n"
"\tNumPy ndarray of n x n dimensions, where n is equal to\n"
"\tthe number of quadrature points containing the\n"
"\tdifferentiation matrix.")
;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment