From 3e4ff5b2a9768cc94f02f2bbfac8439c674d098e Mon Sep 17 00:00:00 2001 From: Jiao Lin <linjiao@ornl.gov> Date: Tue, 13 Oct 2015 17:25:46 -0400 Subject: [PATCH] Refs #13691. Added documenation of parameters for python methods --- .../geometry/src/Exports/BoundingBox.cpp | 23 +- .../mantid/geometry/src/Exports/Component.cpp | 113 +++++----- .../geometry/src/Exports/DetectorGroup.cpp | 2 + .../geometry/src/Exports/Goniometer.cpp | 4 +- .../mantid/geometry/src/Exports/Group.cpp | 62 ++++-- .../geometry/src/Exports/ICompAssembly.cpp | 2 + .../geometry/src/Exports/IComponent.cpp | 29 +-- .../mantid/geometry/src/Exports/IDetector.cpp | 30 +-- .../geometry/src/Exports/IMDDimension.cpp | 40 ++-- .../geometry/src/Exports/IObjComponent.cpp | 5 +- .../geometry/src/Exports/Instrument.cpp | 78 +++---- .../mantid/geometry/src/Exports/MDFrame.cpp | 4 +- .../mantid/geometry/src/Exports/Object.cpp | 3 +- .../geometry/src/Exports/OrientedLattice.cpp | 33 +-- .../mantid/geometry/src/Exports/PeakShape.cpp | 13 +- .../geometry/src/Exports/PointGroup.cpp | 21 +- .../src/Exports/PointGroupFactory.cpp | 9 +- .../src/Exports/RectangularDetector.cpp | 20 +- .../geometry/src/Exports/ReferenceFrame.cpp | 20 +- .../geometry/src/Exports/SpaceGroup.cpp | 28 +-- .../src/Exports/SpaceGroupFactory.cpp | 46 ++-- .../geometry/src/Exports/SymmetryElement.cpp | 19 +- .../src/Exports/SymmetryElementFactory.cpp | 1 + .../src/Exports/SymmetryOperation.cpp | 14 +- .../src/Exports/SymmetryOperationFactory.cpp | 4 + .../mantid/geometry/src/Exports/UnitCell.cpp | 199 +++++++++--------- 26 files changed, 473 insertions(+), 349 deletions(-) diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/BoundingBox.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/BoundingBox.cpp index 47d718238f0..4e864930e38 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/BoundingBox.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/BoundingBox.cpp @@ -8,40 +8,47 @@ using namespace boost::python; void export_BoundingBox() { class_<BoundingBox>("BoundingBox", "Constructs a zero-sized box") - .def(init<double, double, double, double, double, double>( - (arg("xmax"), arg("ymax"), arg("zmax"), arg("xmin"), arg("ymin"), - arg("zmin")), - "Constructs a box from the six given points")) + .def(init<double, double, double, double, double, double> + ((arg("self"), arg("xmax"), arg("ymax"), arg("zmax"), + arg("xmin"), arg("ymin"), arg("zmin")), + "Constructs a box from the six given points")) .def("minPoint", &BoundingBox::minPoint, + arg("self"), return_value_policy<copy_const_reference>(), "Returns a V3D containing the values of the minimum of the box. See " "mantid.kernel.V3D") .def("maxPoint", &BoundingBox::maxPoint, + arg("self"), return_value_policy<copy_const_reference>(), "Returns a V3D containing the values of the minimum of the box. See " "mantid.kernel.V3D") .def("centrePoint", &BoundingBox::centrePoint, + arg("self"), "Returns a V3D containing the coordinates of the centre point. See " "mantid.kernel.V3D") - .def("width", &BoundingBox::width, "Returns a V3D containing the widths " - "for each dimension. See " - "mantid.kernel.V3D") + .def("width", &BoundingBox::width, + arg("self"), + "Returns a V3D containing the widths " + "for each dimension. See " + "mantid.kernel.V3D") .def("isNull", &BoundingBox::isNull, + arg("self"), "Returns true if the box has no dimensions that have been set") .def("isPointInside", &BoundingBox::isPointInside, + arg("self"), "Returns true if the given point is inside the object. See " "mantid.kernel.V3D") .def("doesLineIntersect", (bool (BoundingBox::*)(const V3D &, const V3D &) const) & BoundingBox::doesLineIntersect, - (arg("startPoint"), arg("lineDir")), + (arg("self"), arg("startPoint"), arg("lineDir")), "Returns true if the line given by the starting point & direction " "vector passes through the box"); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp index 5ad6c63e6d0..b79d0cfe051 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp @@ -39,53 +39,70 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getParamDescription, void export_Component() { class_<Component, bases<IComponent>, boost::noncopyable>("Component", no_init) - .def("getParameterNames", &Component::getParameterNames, - Component_getParameterNames()) - .def("hasParameter", &Component::hasParameter, Component_hasParameter()) - .def("getNumberParameter", &Component::getNumberParameter, - Component_getNumberParameter()) - .def("getBoolParameter", &Component::getBoolParameter, - Component_getBoolParameter()) - .def("getPositionParameter", &Component::getPositionParameter, - Component_getPositionParameter()) - .def("getRotationParameter", &Component::getRotationParameter, - Component_getRotationParameter()) - .def("getStringParameter", &Component::getStringParameter, - Component_getStringParameter()) - .def("getIntParameter", &Component::getIntParameter, - Component_getIntParameter()) - // - .def("getRotation", &Component::getRotation, Component_getRotation()) - .def("getRelativePos", &Component::getRelativePos, - Component_getRelativePos()) - // - .def("getParamShortDescription", &Component::getParamShortDescription, - Component_getParamShortDescription()) - .def("getParamDescription", &Component::getParamDescription, - Component_getParamDescription()) - .def("getShortDescription", &Component::getShortDescription, - "Return the short description of current parameterized component") - .def("getDescription", &Component::getDescription, - "Return the description of current parameterized component") - .def("setDescription", &Component::setDescription, - "Set component's description, works only if the component is " - "parameterized component") + .def("getParameterNames", &Component::getParameterNames, + Component_getParameterNames((arg("self"), arg("recursive")=true)) + ) + .def("hasParameter", &Component::hasParameter, + Component_hasParameter + ((arg("self"), arg("name"), arg("recursive")=true))) + .def("getNumberParameter", &Component::getNumberParameter, + Component_getNumberParameter + ((arg("self"), arg("pname"), arg("recursive")=true))) + .def("getBoolParameter", &Component::getBoolParameter, + Component_getBoolParameter + ((arg("self"), arg("pname"), arg("recursive")=true))) + .def("getPositionParameter", &Component::getPositionParameter, + Component_getPositionParameter + ((arg("self"), arg("pname"), arg("recursive")=true))) + .def("getRotationParameter", &Component::getRotationParameter, + Component_getRotationParameter + ((arg("self"), arg("pname"), arg("recursive")=true))) + .def("getStringParameter", &Component::getStringParameter, + Component_getStringParameter + ((arg("self"), arg("pname"), arg("recursive")=true))) + .def("getIntParameter", &Component::getIntParameter, + Component_getIntParameter + ((arg("self"), arg("pname"), arg("recursive")=true))) + // + .def("getRotation", &Component::getRotation, + Component_getRotation(arg("self"))) + .def("getRelativePos", &Component::getRelativePos, + Component_getRelativePos(arg("self"))) + // + .def("getParamShortDescription", &Component::getParamShortDescription, + Component_getParamShortDescription + ((arg("self"), arg("pname"), arg("recursive")=true))) + .def("getParamDescription", &Component::getParamDescription, + Component_getParamDescription + ((arg("self"), arg("pname"), arg("recursive")=true))) + + .def("getShortDescription", &Component::getShortDescription, + arg("self"), + "Return the short description of current parameterized component") + .def("getDescription", &Component::getDescription, + arg("self"), + "Return the description of current parameterized component") + .def("setDescription", &Component::setDescription, + (arg("self"), arg("descr")), + "Set component's description, works only if the component is " + "parameterized component") - // HACK -- python should return parameters regardless of type. this is - // untill rows below do not work - .def("getParameterType", &Component::getParameterType, - Component_getParameterType()) - //// this does not work for some obvious or not obvious reasons - //.def("getParameter", &Component::getNumberParameter, - // Component_getNumberParameter()) - //.def("getParameter", &Component::getBoolParameter, - // Component_getBoolParameter()) - //.def("getParameter", &Component::getStringParameter, - // Component_getStringParameter()) - //.def("getParameter", &Component::getPositionParameter, - // Component_getPositionParameter()) - //.def("getParameter", &Component::getRotationParameter, - // Component_getRotationParameter()) - - ; + // HACK -- python should return parameters regardless of type. this is + // untill rows below do not work + .def("getParameterType", &Component::getParameterType, + Component_getParameterType + ((arg("self"), arg("pname"), arg("recursive")=true))) + //// this does not work for some obvious or not obvious reasons + //.def("getParameter", &Component::getNumberParameter, + // Component_getNumberParameter()) + //.def("getParameter", &Component::getBoolParameter, + // Component_getBoolParameter()) + //.def("getParameter", &Component::getStringParameter, + // Component_getStringParameter()) + //.def("getParameter", &Component::getPositionParameter, + // Component_getPositionParameter()) + //.def("getParameter", &Component::getRotationParameter, + // Component_getRotationParameter()) + + ; } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorGroup.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorGroup.cpp index fe6107d725d..027f012747e 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorGroup.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorGroup.cpp @@ -9,7 +9,9 @@ void export_DetectorGroup() { class_<DetectorGroup, bases<IDetector>, boost::noncopyable>("DetectorGroup", no_init) .def("getDetectorIDs", &DetectorGroup::getDetectorIDs, + arg("self"), "Returns the list of detector IDs within this group") .def("getNameSeparator", &DetectorGroup::getNameSeparator, + arg("self"), "Returns separator for list of names of detectors"); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp index 184ca40caf1..ce9e6c0f80e 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp @@ -37,6 +37,6 @@ void export_Goniometer() { getEulerAngles_overloads(args("self", "convention"), "Default convention is \'YZX\'. Universal " "goniometer is \'YZY\'")) - .def("getR", &Goniometer::getR, return_readonly_numpy()) - .def("setR", &setR); + .def("getR", &Goniometer::getR, arg("self"), return_readonly_numpy()) + .def("setR", &setR, (arg("self"), arg("rot"))); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/Group.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/Group.cpp index cc83d3c6c3d..a2aae13b228 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/Group.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/Group.cpp @@ -64,25 +64,45 @@ void export_Group() { .value("Associativity", Group::Associativity); class_<Group, boost::noncopyable>("Group", no_init) - .def("__init__", make_constructor(&constructGroupFromString), - "Construct a group from the provided initializer string.") - .def("__init__", make_constructor(&constructGroupFromVector), - "Construct a group from the provided symmetry operation list.") - .def("__init__", make_constructor(&constructGroupFromPythonList), - "Construct a group from a python generated symmetry operation list.") - .def("getOrder", &Group::order, "Returns the order of the group.") - .def("getCoordinateSystem", &Group::getCoordinateSystem, - "Returns the type of coordinate system to distinguish groups with " - "hexagonal system definition.") - .def("getSymmetryOperations", &Group::getSymmetryOperations, - "Returns the symmetry operations contained in the group.") - .def("getSymmetryOperationStrings", &getSymmetryOperationStrings, - "Returns the x,y,z-strings for the contained symmetry operations.") - .def("containsOperation", &Group::containsOperation, - "Checks whether a SymmetryOperation is included in Group.") - .def("isGroup", &Group::isGroup, "Checks whether the contained symmetry " - "operations fulfill the group axioms.") - .def("fulfillsAxiom", &Group::fulfillsAxiom, - "Checks if the contained symmetry operations fulfill the specified " - "group axiom."); + .def("__init__", + make_constructor + (&constructGroupFromString, + default_call_policies(), + (arg("symmetryOperationString"))), + "Construct a group from the provided initializer string.") + .def("__init__", + make_constructor + (&constructGroupFromVector, + default_call_policies(), + (arg("symmetryOperationVector"))), + "Construct a group from the provided symmetry operation list.") + .def("__init__", + make_constructor + (&constructGroupFromPythonList, + default_call_policies(), + (arg("symmetryOperationList"))), + "Construct a group from a python generated symmetry operation list.") + .def("getOrder", &Group::order, arg("self"), + "Returns the order of the group.") + .def("getCoordinateSystem", &Group::getCoordinateSystem, + arg("self"), + "Returns the type of coordinate system to distinguish groups with " + "hexagonal system definition.") + .def("getSymmetryOperations", &Group::getSymmetryOperations, + arg("self"), + "Returns the symmetry operations contained in the group.") + .def("getSymmetryOperationStrings", &getSymmetryOperationStrings, + arg("self"), + "Returns the x,y,z-strings for the contained symmetry operations.") + .def("containsOperation", &Group::containsOperation, + (arg("self"), arg("operation")), + "Checks whether a SymmetryOperation is included in Group.") + .def("isGroup", &Group::isGroup, + arg("self"), + "Checks whether the contained symmetry " + "operations fulfill the group axioms.") + .def("fulfillsAxiom", &Group::fulfillsAxiom, + (arg("self"), arg("axiom")), + "Checks if the contained symmetry operations fulfill the specified " + "group axiom."); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/ICompAssembly.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/ICompAssembly.cpp index bc8d4d2cec5..d82744edacc 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/ICompAssembly.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/ICompAssembly.cpp @@ -12,7 +12,9 @@ void export_ICompAssembly() { class_<ICompAssembly, boost::python::bases<IComponent>, boost::noncopyable>( "ICompAssembly", no_init) .def("nelements", &ICompAssembly::nelements, + arg("self"), "Returns the number of elements in the assembly") .def("__getitem__", &ICompAssembly::operator[], + (arg("self"), arg("index")), "Return the component at the given index"); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/IComponent.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/IComponent.cpp index ff0a9194122..c59eb740f23 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/IComponent.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/IComponent.cpp @@ -29,16 +29,21 @@ void export_IComponent() { register_ptr_to_python<boost::shared_ptr<IComponent>>(); class_<IComponent, boost::noncopyable>("IComponent", no_init) - .def("getPos", &IComponent::getPos, - "Returns the absolute position of the component") - .def("getDistance", &getDistance, "Returns the distance, in metres, " - "between this and the given component") - .def("getName", &IComponent::getName, "Returns the name of the component") - .def("getFullName", &IComponent::getFullName, - "Returns full path name of component") - .def("type", &IComponent::type, - "Returns the type of the component represented as a string") - .def("getRelativeRot", &IComponent::getRelativeRot, - return_value_policy<copy_const_reference>(), - "Returns the relative rotation as a Quat"); + .def("getPos", &IComponent::getPos, + arg("self"), + "Returns the absolute position of the component") + .def("getDistance", &getDistance, + (arg("self"), arg("other")), + "Returns the distance, in metres, " + "between this and the given component") + .def("getName", &IComponent::getName, arg("self"), + "Returns the name of the component") + .def("getFullName", &IComponent::getFullName, arg("self"), + "Returns full path name of component") + .def("type", &IComponent::type, arg("self"), + "Returns the type of the component represented as a string") + .def("getRelativeRot", &IComponent::getRelativeRot, + arg("self"), + return_value_policy<copy_const_reference>(), + "Returns the relative rotation as a Quat"); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/IDetector.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/IDetector.cpp index 8bb8d029989..adc2b6c2ffb 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/IDetector.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/IDetector.cpp @@ -11,18 +11,20 @@ void export_IDetector() { class_<IDetector, bases<IObjComponent>, boost::noncopyable>("IDetector", no_init) - .def("getID", &IDetector::getID, "Returns the detector ID") - .def("isMasked", &IDetector::isMasked, "Returns the value of the masked " - "flag. True means ignore this " - "detector") - .def("isMonitor", &IDetector::isMonitor, - "Returns True if the detector is marked as a monitor in the IDF") - .def("solidAngle", &IDetector::solidAngle, "Return the solid angle in " - "steradians between this " - "detector and an observer") - .def("getTwoTheta", &IDetector::getTwoTheta, - "Calculate the angle between this detector, another component and " - "an axis") - .def("getPhi", &IDetector::getPhi, - "Returns the azimuthal angle of this detector"); + .def("getID", &IDetector::getID, arg("self"), "Returns the detector ID") + .def("isMasked", &IDetector::isMasked, arg("self"), + "Returns the value of the masked flag. True means ignore this " + "detector") + .def("isMonitor", &IDetector::isMonitor, arg("self"), + "Returns True if the detector is marked as a monitor in the IDF") + .def("solidAngle", &IDetector::solidAngle, + (arg("self"), arg("observer")), + "Return the solid angle in steradians between this " + "detector and an observer") + .def("getTwoTheta", &IDetector::getTwoTheta, + (arg("self"), arg("observer"), arg("axis")), + "Calculate the angle between this detector, another component and " + "an axis") + .def("getPhi", &IDetector::getPhi, arg("self"), + "Returns the azimuthal angle of this detector"); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/IMDDimension.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/IMDDimension.cpp index 7f32083e78f..1c3eda82316 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/IMDDimension.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/IMDDimension.cpp @@ -39,24 +39,24 @@ void export_IMDDimension() { register_ptr_to_python<boost::shared_ptr<IMDDimension>>(); class_<IMDDimension, boost::noncopyable>("IMDDimension", no_init) - .def("getName", &IMDDimension::getName, "Return the name of the " - "dimension as can be displayed " - "along the axis") - .def("getMaximum", &IMDDimension::getMaximum, - "Return the maximum extent of this dimension") - .def("getMinimum", &IMDDimension::getMinimum, - "Return the maximum extent of this dimension") - .def("getNBins", &IMDDimension::getNBins, - "Return the number of bins dimension have (an integrated has one). " - "A axis directed along dimension would have getNBins+1 axis points.") - .def("getX", &IMDDimension::getX, - "Return coordinate of the axis at the given index") - .def("getDimensionId", &IMDDimension::getDimensionId, - "Return a short name which identify the dimension among other " - "dimension." - "A dimension can be usually find by its ID and various ") - .def("getUnits", &getUnitsAsStr, - "Return the units associated with this dimension.") - .def("getMDFrame", &getMDFrame, - "Return the multidimensional frame for this dimension."); + .def("getName", &IMDDimension::getName, arg("self"), + "Return the name of the dimension as can be displayed " + "along the axis") + .def("getMaximum", &IMDDimension::getMaximum, arg("self"), + "Return the maximum extent of this dimension") + .def("getMinimum", &IMDDimension::getMinimum, arg("self"), + "Return the maximum extent of this dimension") + .def("getNBins", &IMDDimension::getNBins, arg("self"), + "Return the number of bins dimension have (an integrated has one). " + "A axis directed along dimension would have getNBins+1 axis points.") + .def("getX", &IMDDimension::getX, (arg("self"), arg("ind")), + "Return coordinate of the axis at the given index") + .def("getDimensionId", &IMDDimension::getDimensionId, arg("self"), + "Return a short name which identify the dimension among other " + "dimension." + "A dimension can be usually find by its ID and various ") + .def("getUnits", &getUnitsAsStr, arg("self"), + "Return the units associated with this dimension.") + .def("getMDFrame", &getMDFrame, arg("self"), + "Return the multidimensional frame for this dimension."); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/IObjComponent.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/IObjComponent.cpp index cf9a708a50e..cf56507f695 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/IObjComponent.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/IObjComponent.cpp @@ -25,6 +25,7 @@ void export_IObjComponent() { class_<IObjComponent, boost::python::bases<IComponent>, boost::noncopyable>( "IObjComponent", no_init) - .def("shape", &getShape, "Get the object that represents the physical " - "shape of this component"); + .def("shape", &getShape, arg("self"), + "Get the object that represents the physical shape of this component" + ); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/Instrument.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/Instrument.cpp index d7ba8222708..7fe291a9cb4 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/Instrument.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/Instrument.cpp @@ -15,41 +15,45 @@ void export_Instrument() { class_<Instrument, bases<CompAssembly>, boost::noncopyable>("Instrument", no_init) - .def("getSample", &Instrument::getSample, - return_value_policy<RemoveConstSharedPtr>(), - "Return the object that represents the sample") - - .def("getSource", &Instrument::getSource, - return_value_policy<RemoveConstSharedPtr>(), - "Return the object that represents the source") - - .def("getComponentByName", - (boost::shared_ptr<IComponent>(Instrument::*)(const std::string &)) & - Instrument::getComponentByName, - "Returns the named component") - - .def("getDetector", (boost::shared_ptr<IDetector>( - Instrument::*)(const detid_t &) const) & - Instrument::getDetector, - "Returns the detector with the given ID") - - .def("getReferenceFrame", - (boost::shared_ptr<const ReferenceFrame>(Instrument::*)()) & - Instrument::getReferenceFrame, - return_value_policy<RemoveConstSharedPtr>(), - "Returns the reference frame attached that defines the instrument " - "axes") - - .def("getValidFromDate", &Instrument::getValidFromDate, - "Return the valid from date of the instrument") - - .def("getValidToDate", &Instrument::getValidToDate, - "Return the valid to date of the instrument") - - .def("getBaseInstrument", &Instrument::baseInstrument, - return_value_policy<RemoveConstSharedPtr>(), - "Return reference to the base instrument"); - ; - - ; + .def("getSample", &Instrument::getSample, arg("self"), + return_value_policy<RemoveConstSharedPtr>(), + "Return the object that represents the sample") + + .def("getSource", &Instrument::getSource, arg("self"), + return_value_policy<RemoveConstSharedPtr>(), + "Return the object that represents the source") + + .def("getComponentByName", + (boost::shared_ptr<IComponent>(Instrument::*)(const std::string &)) & + Instrument::getComponentByName, + (arg("self"), arg("cname")), + "Returns the named component") + + .def("getDetector", + (boost::shared_ptr<IDetector>(Instrument::*)(const detid_t &) const) & + Instrument::getDetector, + (arg("self"), arg("detector_id")), + "Returns the detector with the given ID") + + .def("getReferenceFrame", + (boost::shared_ptr<const ReferenceFrame>(Instrument::*)()) & + Instrument::getReferenceFrame, + arg("self"), + return_value_policy<RemoveConstSharedPtr>(), + "Returns the reference frame attached that defines the instrument " + "axes") + + .def("getValidFromDate", &Instrument::getValidFromDate, + arg("self"), + "Return the valid from date of the instrument") + + .def("getValidToDate", &Instrument::getValidToDate, + arg("self"), + "Return the valid to date of the instrument") + + .def("getBaseInstrument", &Instrument::baseInstrument, + arg("self"), + return_value_policy<RemoveConstSharedPtr>(), + "Return reference to the base instrument") + ; } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/MDFrame.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/MDFrame.cpp index 3f6a3e2ed81..cd988294e63 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/MDFrame.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/MDFrame.cpp @@ -13,6 +13,6 @@ void export_MDFrame() { register_ptr_to_python<boost::shared_ptr<MDFrame>>(); class_<MDFrame, boost::noncopyable>("MDFrame", no_init) - .def("getUnitLabel", &MDFrame::getUnitLabel) - .def("name", &MDFrame::name); + .def("getUnitLabel", &MDFrame::getUnitLabel, arg("self")) + .def("name", &MDFrame::name, arg("self")); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/Object.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/Object.cpp index 756ed9f2b7d..c4d7783edd5 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/Object.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/Object.cpp @@ -13,9 +13,10 @@ void export_Object() { class_<Object, boost::noncopyable>("Object", no_init) .def("getBoundingBox", (const BoundingBox &(Object::*)() const) & Object::getBoundingBox, + arg("self"), return_value_policy<copy_const_reference>(), "Return the axis-aligned bounding box for this shape") - .def("getShapeXML", &Object::getShapeXML, + .def("getShapeXML", &Object::getShapeXML, arg("self"), "Returns the XML that was used to create this shape."); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/OrientedLattice.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/OrientedLattice.cpp index b392a312a8e..49d1f62e5c7 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/OrientedLattice.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/OrientedLattice.cpp @@ -49,19 +49,22 @@ void export_OrientedLattice() { return_readonly_numpy; class_<OrientedLattice, bases<UnitCell>>("OrientedLattice", init<>()) - .def(init<OrientedLattice const &>((arg("other")))) - .def(init<double, double, double>((arg("_a"), arg("_b"), arg("_c")))) - .def(init<double, double, double, double, double, double, optional<int>>( - (arg("_a"), arg("_b"), arg("_c"), arg("_alpha"), arg("_beta"), - arg("_gamma"), arg("Unit") = (int)(angDegrees)))) - .def(init<UnitCell>(arg("uc"))) - .def("getuVector", (&OrientedLattice::getuVector)) - .def("getvVector", (&OrientedLattice::getvVector)) - .def("getU", &OrientedLattice::getU, return_readonly_numpy()) - .def("setU", &setU) - .def("getUB", &OrientedLattice::getUB, return_readonly_numpy()) - .def("setUB", &setUB) - .def("setUFromVectors", &setUFromVectors) - .def("qFromHKL", &qFromHKL, "Q vector from HKL vector") - .def("hklFromQ", &hklFromQ, "HKL value from Q vector"); + .def(init<OrientedLattice const &>((arg("other")))) + .def(init<double, double, double>((arg("_a"), arg("_b"), arg("_c")))) + .def(init<double, double, double, double, double, double, + optional<int>> + ((arg("_a"), arg("_b"), arg("_c"), arg("_alpha"), arg("_beta"), + arg("_gamma"), arg("Unit") = (int)(angDegrees)))) + .def(init<UnitCell>(arg("uc"))) + .def("getuVector", (&OrientedLattice::getuVector), arg("self")) + .def("getvVector", (&OrientedLattice::getvVector), arg("self")) + .def("getU", &OrientedLattice::getU, arg("self"), return_readonly_numpy()) + .def("setU", &setU, (arg("self"), arg("newU"))) + .def("getUB", &OrientedLattice::getUB, arg("self"), return_readonly_numpy()) + .def("setUB", &setUB, (arg("self"), arg("newUB"))) + .def("setUFromVectors", &setUFromVectors, (arg("self"), arg("u"), arg("v"))) + .def("qFromHKL", &qFromHKL, (arg("self"), arg("vec")), + "Q vector from HKL vector") + .def("hklFromQ", &hklFromQ, (arg("self"), arg("vec")), + "HKL value from Q vector"); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/PeakShape.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/PeakShape.cpp index 420e07c0ea2..89f6f20b34d 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/PeakShape.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/PeakShape.cpp @@ -9,10 +9,11 @@ void export_PeakShape() { register_ptr_to_python<Mantid::Geometry::PeakShape_sptr>(); class_<PeakShape, boost::noncopyable>("PeakShape", no_init) - .def("toJSON", &PeakShape::toJSON, "Serialize object to JSON") - .def("shapeName", &PeakShape::shapeName, "Shape name for type of shape") - .def("algorithmVersion", &PeakShape::algorithmVersion, - "Number of source integration algorithm version") - .def("algorithmName", &PeakShape::algorithmName, - "Name of source integration algorithm"); + .def("toJSON", &PeakShape::toJSON, arg("self"), "Serialize object to JSON") + .def("shapeName", &PeakShape::shapeName, arg("self"), + "Shape name for type of shape") + .def("algorithmVersion", &PeakShape::algorithmVersion, arg("self"), + "Number of source integration algorithm version") + .def("algorithmName", &PeakShape::algorithmName, arg("self"), + "Name of source integration algorithm"); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroup.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroup.cpp index 31d222c1a7f..010d14c4deb 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroup.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroup.cpp @@ -55,14 +55,15 @@ void export_PointGroup() { .value("Cubic", PointGroup::Cubic); class_<PointGroup, boost::noncopyable, bases<Group>>("PointGroup", no_init) - .def("getName", &PointGroup::getName) - .def("getHMSymbol", &PointGroup::getSymbol) - .def("getCrystalSystem", &PointGroup::crystalSystem) - .def("isEquivalent", &isEquivalent, - "Check whether the two HKLs are symmetrically equivalent.") - .def("getEquivalents", &getEquivalents, "Returns an array with all " - "symmetry equivalents of the " - "supplied HKL.") - .def("getReflectionFamily", &getReflectionFamily, - "Returns the same HKL for all symmetry equivalents."); + .def("getName", &PointGroup::getName, arg("self")) + .def("getHMSymbol", &PointGroup::getSymbol, arg("self")) + .def("getCrystalSystem", &PointGroup::crystalSystem, arg("self")) + .def("isEquivalent", &isEquivalent, + (arg("self"), arg("hkl1"), arg("hkl2")), + "Check whether the two HKLs are symmetrically equivalent.") + .def("getEquivalents", &getEquivalents, (arg("self"), arg("hkl")), + "Returns an array with all symmetry equivalents of the supplied HKL.") + .def("getReflectionFamily", &getReflectionFamily, + (arg("self"), arg("hkl")), + "Returns the same HKL for all symmetry equivalents."); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroupFactory.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroupFactory.cpp index 0ec8f5c51de..b01885743b5 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroupFactory.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/PointGroupFactory.cpp @@ -25,19 +25,26 @@ void export_PointGroupFactory() { class_<PointGroupFactoryImpl, boost::noncopyable>("PointGroupFactoryImpl", no_init) .def("isSubscribed", &PointGroupFactoryImpl::isSubscribed, + (arg("self"), arg("hmSymbol")), "Returns true of the point group with the given symbol is " "subscribed.") .def("createPointGroup", &PointGroupFactoryImpl::createPointGroup, + (arg("self"), arg("hmSymbol")), "Creates a point group if registered.") - .def("createPointGroupFromSpaceGroup", &getPointGroupFromSpaceGroup, + .def("createPointGroupFromSpaceGroup", + &getPointGroupFromSpaceGroup, + (arg("self"), arg("group")), "Creates the point group that corresponds to the given space group.") .def("createPointGroupFromSpaceGroupSymbol", &getPointGroupFromSpaceGroupSymbol, + (arg("self"), arg("group")), "Creates a point group directly from the space group symbol.") .def("getAllPointGroupSymbols", &PointGroupFactoryImpl::getAllPointGroupSymbols, + arg("self"), "Returns all registered point group symbols.") .def("getPointGroupSymbols", &PointGroupFactoryImpl::getPointGroupSymbols, + (arg("self"), arg("crystalsystem")), "Returns all point groups registered for the given crystal system.") .def("Instance", &PointGroupFactory::Instance, return_value_policy<reference_existing_object>(), diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/RectangularDetector.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/RectangularDetector.cpp index 01cf57f0361..cc6420e29dc 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/RectangularDetector.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/RectangularDetector.cpp @@ -17,30 +17,46 @@ void export_RectangularDetector() { class_<RectangularDetector, bases<CompAssembly, IObjComponent>, boost::noncopyable>("RectangularDetector", no_init) .def("xpixels", &RectangularDetector::xpixels, + arg("self"), "Returns the number of pixels in the X direction") .def("ypixels", &RectangularDetector::ypixels, + arg("self"), "Returns the number of pixels in the Y direction") .def("xstep", &RectangularDetector::xstep, + arg("self"), "Returns the step size in the X direction") .def("ystep", &RectangularDetector::ystep, + arg("self"), "Returns the step size in the Y direction") .def("xsize", &RectangularDetector::xsize, + arg("self"), "Returns the size in the X direction") .def("ysize", &RectangularDetector::ysize, + arg("self"), "Returns the size in the Y direction") .def("xstart", &RectangularDetector::xstart, + arg("self"), "Returns the start position in the X direction") .def("ystart", &RectangularDetector::ystart, + arg("self"), "Returns the start position in the Y direction") - .def("idstart", &RectangularDetector::idstart, "Returns the idstart") + .def("idstart", &RectangularDetector::idstart, + arg("self"), + "Returns the idstart") .def("idfillbyfirst_y", &RectangularDetector::idfillbyfirst_y, + arg("self"), "Returns the idfillbyfirst_y") .def("idstepbyrow", &RectangularDetector::idstepbyrow, + arg("self"), "Returns the idstepbyrow") - .def("idstep", &RectangularDetector::idstep, "Returns the idstep") + .def("idstep", &RectangularDetector::idstep, + arg("self"), + "Returns the idstep") .def("minDetectorID", &RectangularDetector::minDetectorID, + arg("self"), "Returns the minimum detector id") .def("maxDetectorID", &RectangularDetector::maxDetectorID, + arg("self"), "Returns the maximum detector id"); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/ReferenceFrame.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/ReferenceFrame.cpp index be19d8047e4..b0b69c85dba 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/ReferenceFrame.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/ReferenceFrame.cpp @@ -21,13 +21,15 @@ void export_ReferenceFrame() { .export_values(); class_<ReferenceFrame, boost::noncopyable>("ReferenceFrame", no_init) - .def("pointingAlongBeam", &ReferenceFrame::pointingAlongBeam) - .def("pointingUp", &ReferenceFrame::pointingUp) - .def("vecPointingUp", &ReferenceFrame::vecPointingUp) - .def("vecPointingAlongBeam", &ReferenceFrame::vecPointingAlongBeam) - .def("pointingAlongBeamAxis", &ReferenceFrame::pointingAlongBeamAxis) - .def("pointingUpAxis", &ReferenceFrame::pointingUpAxis) - .def("pointingHorizontalAxis", &ReferenceFrame::pointingHorizontalAxis) - - ; + .def("pointingAlongBeam", &ReferenceFrame::pointingAlongBeam, arg("self")) + .def("pointingUp", &ReferenceFrame::pointingUp, arg("self")) + .def("vecPointingUp", &ReferenceFrame::vecPointingUp, arg("self")) + .def("vecPointingAlongBeam", &ReferenceFrame::vecPointingAlongBeam, + arg("self")) + .def("pointingAlongBeamAxis", &ReferenceFrame::pointingAlongBeamAxis, + arg("self")) + .def("pointingUpAxis", &ReferenceFrame::pointingUpAxis, arg("self")) + .def("pointingHorizontalAxis", &ReferenceFrame::pointingHorizontalAxis, + arg("self")) + ; } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/SpaceGroup.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/SpaceGroup.cpp index 9b83cabe216..a8d9a851224 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/SpaceGroup.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/SpaceGroup.cpp @@ -53,16 +53,20 @@ void export_SpaceGroup() { register_ptr_to_python<boost::shared_ptr<SpaceGroup>>(); class_<SpaceGroup, boost::noncopyable, bases<Group>>("SpaceGroup", no_init) - .def("getNumber", &SpaceGroup::number) - .def("getHMSymbol", &SpaceGroup::hmSymbol) - .def("getEquivalentPositions", &getEquivalentPositions, - "Returns an array with all symmetry equivalents of the supplied " - "HKL.") - .def("isAllowedReflection", &isAllowedReflection, - "Returns True if the supplied reflection is allowed with respect to " - "space group symmetry operations.") - .def("getPointGroup", &SpaceGroup::getPointGroup, - "Returns the point group of the space group.") - .def("getSiteSymmetryGroup", &getSiteSymmetryGroup, - "Returns the site symmetry group for supplied point coordinates."); + .def("getNumber", &SpaceGroup::number, arg("self")) + .def("getHMSymbol", &SpaceGroup::hmSymbol, arg("self")) + .def("getEquivalentPositions", &getEquivalentPositions, + (arg("self"), arg("point")), + "Returns an array with all symmetry equivalents of the supplied " + "HKL.") + .def("isAllowedReflection", &isAllowedReflection, + (arg("self"), arg("hkl")), + "Returns True if the supplied reflection is allowed with respect to " + "space group symmetry operations.") + .def("getPointGroup", &SpaceGroup::getPointGroup, arg("self"), + "Returns the point group of the space group.") + .def("getSiteSymmetryGroup", &getSiteSymmetryGroup, + (arg("self"), arg("position")), + "Returns the site symmetry group for supplied point coordinates.") + ; } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/SpaceGroupFactory.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/SpaceGroupFactory.cpp index 365d6e02a78..5f0384c252f 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/SpaceGroupFactory.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/SpaceGroupFactory.cpp @@ -44,22 +44,32 @@ void export_SpaceGroupFactory() { class_<SpaceGroupFactoryImpl, boost::noncopyable>("SpaceGroupFactoryImpl", no_init) - .def("isSubscribedSymbol", &isSubscribedSymbol, - "Returns true if the space group the supplied symbol is subscribed.") - .def("isSubscribedNumber", &isSubscribedNumber, - "Returns true if a space group with the given number is subscribed.") - .def("createSpaceGroup", &createSpaceGroup, "Creates a space group.") - .def("getAllSpaceGroupSymbols", &allSpaceGroupSymbols, - "Returns all subscribed space group symbols.") - .def("getAllSpaceGroupNumbers", - &SpaceGroupFactoryImpl::subscribedSpaceGroupNumbers, - "Returns all subscribed space group numbers.") - .def("subscribedSpaceGroupSymbols", &spaceGroupSymbolsForNumber, - "Returns all space group symbols that are registered under the " - "given number.") - .def("getSpaceGroupsForPointGroup", &spaceGroupSymbolsForPointGroup) - .def("Instance", &SpaceGroupFactory::Instance, - return_value_policy<reference_existing_object>(), - "Returns a reference to the SpaceGroupFactory singleton") - .staticmethod("Instance"); + .def("isSubscribedSymbol", &isSubscribedSymbol, + (arg("self"), arg("symbol")), + "Returns true if the space group the supplied symbol is subscribed.") + .def("isSubscribedNumber", &isSubscribedNumber, + (arg("self"), arg("number")), + "Returns true if a space group with the given number is subscribed.") + .def("createSpaceGroup", &createSpaceGroup, + (arg("self"), arg("symbol")), + "Creates a space group.") + .def("getAllSpaceGroupSymbols", &allSpaceGroupSymbols, + arg("self"), + "Returns all subscribed space group symbols.") + .def("getAllSpaceGroupNumbers", + &SpaceGroupFactoryImpl::subscribedSpaceGroupNumbers, + arg("self"), + "Returns all subscribed space group numbers.") + .def("subscribedSpaceGroupSymbols", &spaceGroupSymbolsForNumber, + (arg("self"), arg("number")), + "Returns all space group symbols that are registered under the " + "given number.") + .def("getSpaceGroupsForPointGroup", + &spaceGroupSymbolsForPointGroup, + (arg("self"), arg("pointGroup")) + ) + .def("Instance", &SpaceGroupFactory::Instance, + return_value_policy<reference_existing_object>(), + "Returns a reference to the SpaceGroupFactory singleton") + .staticmethod("Instance"); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryElement.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryElement.cpp index be79196c0fe..b95d57c4099 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryElement.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryElement.cpp @@ -42,12 +42,15 @@ void export_SymmetryElement() { .value("None", SymmetryElementRotation::None); class_<SymmetryElement, boost::noncopyable>("SymmetryElement", no_init) - .def("getHMSymbol", &SymmetryElement::hmSymbol, - "Returns the Hermann-Mauguin symbol for the element.") - .def("getAxis", &getAxis, "Returns the symmetry axis or [0,0,0] for " - "identiy, inversion and translations.") - .def("getRotationSense", &getRotationSense, - "Returns the rotation sense" - "of a rotation axis or None" - "if the element is not a rotation."); + .def("getHMSymbol", &SymmetryElement::hmSymbol, + arg("self"), + "Returns the Hermann-Mauguin symbol for the element.") + .def("getAxis", &getAxis, + arg("self"), + "Returns the symmetry axis or [0,0,0] for " + "identiy, inversion and translations.") + .def("getRotationSense", &getRotationSense, + arg("self"), + "Returns the rotation sense of a rotation axis or None" + "if the element is not a rotation."); } diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryElementFactory.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryElementFactory.cpp index 59db23c9a35..f3970012864 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryElementFactory.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryElementFactory.cpp @@ -9,6 +9,7 @@ void export_SymmetryElementFactory() { class_<SymmetryElementFactoryImpl, boost::noncopyable>( "SymmetryElementFactoryImpl", no_init) .def("createSymElement", &SymmetryElementFactoryImpl::createSymElement, + (arg("self"), arg("operation")), "Creates the symmetry element that corresponds to the supplied " "symmetry operation.") .def("Instance", &SymmetryElementFactory::Instance, diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryOperation.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryOperation.cpp index 180a9153aa9..f7fc5202f8d 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryOperation.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryOperation.cpp @@ -35,18 +35,24 @@ void export_SymmetryOperation() { class_<SymmetryOperation>("SymmetryOperation") .def("getOrder", &SymmetryOperation::order, + arg("self"), "Returns the order of the symmetry operation, which indicates how " "often the operation needs to be applied to a point to arrive at " "identity.") .def("getIdentifier", &SymmetryOperation::identifier, + arg("self"), "The identifier of the operation in x,y,z-notation.") .def("transformCoordinates", &applyToCoordinates, + (arg("self"), arg("coordinates")), "Returns transformed coordinates. For transforming HKLs, use " "transformHKL.") - .def("transformHKL", &applyToVector, "Returns transformed HKLs. For " - "transformation of coordinates use " - "transformCoordinates.") - .def("apply", &applyToVector, "An alias for transformHKL."); + .def("transformHKL", &applyToVector, + (arg("self"), arg("hkl")), + "Returns transformed HKLs. For transformation of coordinates use " + "transformCoordinates.") + .def("apply", &applyToVector, + (arg("self"), arg("hkl")), + "An alias for transformHKL."); std_vector_exporter<Mantid::Geometry::SymmetryOperation>::wrap( "std_vector_symmetryoperation"); diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryOperationFactory.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryOperationFactory.cpp index dc78c2bcd5d..6ba22c63760 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryOperationFactory.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/SymmetryOperationFactory.cpp @@ -25,14 +25,18 @@ void export_SymmetryOperationFactory() { class_<SymmetryOperationFactoryImpl, boost::noncopyable>( "SymmetryOperationFactoryImpl", no_init) .def("exists", &SymmetryOperationFactoryImpl::isSubscribed, + (arg("self"), arg("identifier")), "Returns true if the symmetry operation is supplied.") .def("createSymOp", &SymmetryOperationFactoryImpl::createSymOp, + (arg("self"), arg("identifier")), "Creates the symmetry operation from the supplied x,y,z-identifier.") .def("createSymOps", &createSymOps, + (arg("self"), arg("identifier")), "Creates a vector of SymmetryOperation objects from a semi-colon " "separated list of x,y,z-identifiers.") .def("subscribedSymbols", &SymmetryOperationFactoryImpl::subscribedSymbols, + arg("self"), "Return all subscribed symbols.") .def("Instance", &SymmetryOperationFactory::Instance, return_value_policy<reference_existing_object>(), diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/UnitCell.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/UnitCell.cpp index 9da36354a38..6e8fa294174 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/UnitCell.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/UnitCell.cpp @@ -38,103 +38,108 @@ void export_UnitCell() { return_readonly_numpy; class_<UnitCell>("UnitCell", init<>()) - .def(init<UnitCell const &>(arg("other"))) - .def(init<double, double, double>((arg("_a"), arg("_b"), arg("_c")))) - .def(init<double, double, double, double, double, double, optional<int>>( - (arg("_a"), arg("_b"), arg("_c"), arg("_alpha"), arg("_beta"), - arg("_gamma"), arg("Unit") = (int)(angDegrees)))) - .def("a", (double (UnitCell::*)() const) & UnitCell::a) - .def("a1", (double (UnitCell::*)() const) & UnitCell::a1) - .def("a2", (double (UnitCell::*)() const) & UnitCell::a2) - .def("a3", (double (UnitCell::*)() const) & UnitCell::a3) - .def("alpha", (double (UnitCell::*)() const) & UnitCell::alpha) - .def("alpha1", (double (UnitCell::*)() const) & UnitCell::alpha1) - .def("alpha2", (double (UnitCell::*)() const) & UnitCell::alpha2) - .def("alpha3", (double (UnitCell::*)() const) & UnitCell::alpha3) - .def("alphastar", (double (UnitCell::*)() const) & UnitCell::alphastar) - .def("astar", (double (UnitCell::*)() const) & UnitCell::astar) - .def("b", (double (UnitCell::*)() const) & UnitCell::b) - .def("b1", (double (UnitCell::*)() const) & UnitCell::b1) - .def("b2", (double (UnitCell::*)() const) & UnitCell::b2) - .def("b3", (double (UnitCell::*)() const) & UnitCell::b3) - .def("beta", (double (UnitCell::*)() const) & UnitCell::beta) - .def("beta1", (double (UnitCell::*)() const) & UnitCell::beta1) - .def("beta2", (double (UnitCell::*)() const) & UnitCell::beta2) - .def("beta3", (double (UnitCell::*)() const) & UnitCell::beta3) - .def("betastar", (double (UnitCell::*)() const) & UnitCell::betastar) - .def("bstar", (double (UnitCell::*)() const) & UnitCell::bstar) - .def("c", (double (UnitCell::*)() const) & UnitCell::c) - .def("cstar", (double (UnitCell::*)() const) & UnitCell::cstar) - .def("d", - (double (UnitCell::*)(double, double, double) const) & UnitCell::d, - (arg("h"), arg("k"), arg("l"))) - .def("d", (double (UnitCell::*)(const V3D &) const) & UnitCell::d, - (arg("hkl"))) - .def("dstar", (double (UnitCell::*)(double, double, double) const) & - UnitCell::dstar, - (arg("h"), arg("k"), arg("l"))) - .def("errora", (double (UnitCell::*)() const) & UnitCell::errora) - .def("errorb", (double (UnitCell::*)() const) & UnitCell::errorb) - .def("errorc", (double (UnitCell::*)() const) & UnitCell::errorc) - .def("erroralpha", - (double (UnitCell::*)(int const) const) & UnitCell::erroralpha, - (arg("Unit") = (int)(angDegrees))) - .def("errorbeta", - (double (UnitCell::*)(int const) const) & UnitCell::errorbeta, - (arg("Unit") = (int)(angDegrees))) - .def("errorgamma", - (double (UnitCell::*)(int const) const) & UnitCell::errorgamma, - (arg("Unit") = (int)(angDegrees))) - .def("gamma", (double (UnitCell::*)() const) & UnitCell::gamma) - .def("gammastar", (double (UnitCell::*)() const) & UnitCell::gammastar) - .def("recAngle", (double (UnitCell::*)(double, double, double, double, - double, double, int const) const) & - UnitCell::recAngle, - (arg("h1"), arg("k1"), arg("l1"), arg("h2"), arg("k2"), arg("l2"), - arg("Unit") = (int)(angDegrees))) - .def("recVolume", (double (UnitCell::*)() const) & UnitCell::recVolume) - .def("set", (void (UnitCell::*)(double, double, double, double, double, - double, int const)) & - UnitCell::set, - (arg("_a"), arg("_b"), arg("_c"), arg("_alpha"), arg("_beta"), - arg("_gamma"), arg("Unit") = (int)(angDegrees))) - .def("seta", (void (UnitCell::*)(double))(&UnitCell::seta), (arg("_a"))) - .def("setalpha", - (void (UnitCell::*)(double, int const))(&UnitCell::setalpha), - (arg("_alpha"), arg("Unit") = (int)(angDegrees))) - .def("setb", (void (UnitCell::*)(double))(&UnitCell::setb), (arg("_b"))) - .def("setbeta", - (void (UnitCell::*)(double, int const))(&UnitCell::setbeta), - (arg("_beta"), arg("Unit") = (int)(angDegrees))) - .def("setc", (void (UnitCell::*)(double))(&UnitCell::setc), (arg("_c"))) - .def("setgamma", - (void (UnitCell::*)(double, int const))(&UnitCell::setgamma), - (arg("_gamma"), arg("Unit") = (int)(angDegrees))) - .def("setError", (void (UnitCell::*)(double, double, double, double, - double, double, int const)) & - UnitCell::setError, - (arg("_aerr"), arg("_berr"), arg("_cerr"), arg("_alphaerr"), - arg("_betaerr"), arg("_gammaerr"), arg("Unit") = (int)(angDegrees))) - .def("setErrora", (void (UnitCell::*)(double))(&UnitCell::setErrora), - (arg("_aerr"))) - .def("setErroralpha", - (void (UnitCell::*)(double, int const))(&UnitCell::setErroralpha), - (arg("_alphaerr"), arg("Unit") = (int)(angDegrees))) - .def("setErrorb", (void (UnitCell::*)(double))(&UnitCell::setErrorb), - (arg("_berr"))) - .def("setErrorbeta", - (void (UnitCell::*)(double, int const))(&UnitCell::setErrorbeta), - (arg("_betaerr"), arg("Unit") = (int)(angDegrees))) - .def("setErrorc", (void (UnitCell::*)(double))(&UnitCell::setErrorc), - (arg("_cerr"))) - .def("setErrorgamma", - (void (UnitCell::*)(double, int const))(&UnitCell::setErrorgamma), - (arg("_gammaerr"), arg("Unit") = (int)(angDegrees))) - .def("volume", (double (UnitCell::*)() const) & UnitCell::volume) - .def("getG", &UnitCell::getG, return_readonly_numpy()) - .def("getGstar", &UnitCell::getGstar, return_readonly_numpy()) - .def("getB", &UnitCell::getB, return_readonly_numpy()) - .def("recalculateFromGstar", &recalculateFromGstar); + .def(init<UnitCell const &>((arg("self"), arg("other")))) + .def(init<double, double, double> + ((arg("self"), arg("_a"), arg("_b"), arg("_c")))) + .def(init<double, double, double, double, double, double, optional<int>> + ((arg("self"), arg("_a"), arg("_b"), arg("_c"), + arg("_alpha"), arg("_beta"), arg("_gamma"), + arg("Unit") = (int)(angDegrees)))) + .def("a", (double (UnitCell::*)() const) & UnitCell::a, arg("self")) + .def("a1", (double (UnitCell::*)() const) & UnitCell::a1, arg("self")) + .def("a2", (double (UnitCell::*)() const) & UnitCell::a2, arg("self")) + .def("a3", (double (UnitCell::*)() const) & UnitCell::a3, arg("self")) + .def("alpha", (double (UnitCell::*)() const) & UnitCell::alpha, arg("self")) + .def("alpha1", (double (UnitCell::*)() const) & UnitCell::alpha1, arg("self")) + .def("alpha2", (double (UnitCell::*)() const) & UnitCell::alpha2, arg("self")) + .def("alpha3", (double (UnitCell::*)() const) & UnitCell::alpha3, arg("self")) + .def("alphastar", (double (UnitCell::*)() const) & UnitCell::alphastar, arg("self")) + .def("astar", (double (UnitCell::*)() const) & UnitCell::astar, arg("self")) + .def("b", (double (UnitCell::*)() const) & UnitCell::b, arg("self")) + .def("b1", (double (UnitCell::*)() const) & UnitCell::b1, arg("self")) + .def("b2", (double (UnitCell::*)() const) & UnitCell::b2, arg("self")) + .def("b3", (double (UnitCell::*)() const) & UnitCell::b3, arg("self")) + .def("beta", (double (UnitCell::*)() const) & UnitCell::beta, arg("self")) + .def("beta1", (double (UnitCell::*)() const) & UnitCell::beta1, arg("self")) + .def("beta2", (double (UnitCell::*)() const) & UnitCell::beta2, arg("self")) + .def("beta3", (double (UnitCell::*)() const) & UnitCell::beta3, arg("self")) + .def("betastar", (double (UnitCell::*)() const) & UnitCell::betastar, arg("self")) + .def("bstar", (double (UnitCell::*)() const) & UnitCell::bstar, arg("self")) + .def("c", (double (UnitCell::*)() const) & UnitCell::c, arg("self")) + .def("cstar", (double (UnitCell::*)() const) & UnitCell::cstar, arg("self")) + .def("d", + (double (UnitCell::*)(double, double, double) const) & UnitCell::d, + (arg("self"), arg("h"), arg("k"), arg("l"))) + .def("d", (double (UnitCell::*)(const V3D &) const) & UnitCell::d, + (arg("self"), arg("hkl"))) + .def("dstar", (double (UnitCell::*)(double, double, double) const) & + UnitCell::dstar, + (arg("self"), arg("h"), arg("k"), arg("l"))) + .def("errora", (double (UnitCell::*)() const) & UnitCell::errora, arg("self")) + .def("errorb", (double (UnitCell::*)() const) & UnitCell::errorb, arg("self")) + .def("errorc", (double (UnitCell::*)() const) & UnitCell::errorc, arg("self")) + .def("erroralpha", + (double (UnitCell::*)(int const) const) & UnitCell::erroralpha, + (arg("self"), arg("Unit") = (int)(angDegrees))) + .def("errorbeta", + (double (UnitCell::*)(int const) const) & UnitCell::errorbeta, + (arg("self"), arg("Unit") = (int)(angDegrees))) + .def("errorgamma", + (double (UnitCell::*)(int const) const) & UnitCell::errorgamma, + (arg("self"), arg("Unit") = (int)(angDegrees))) + .def("gamma", (double (UnitCell::*)() const) & UnitCell::gamma, arg("self")) + .def("gammastar", (double (UnitCell::*)() const) & UnitCell::gammastar, arg("self")) + .def("recAngle", (double (UnitCell::*)(double, double, double, double, + double, double, int const) const) & + UnitCell::recAngle, + (arg("self"), arg("h1"), arg("k1"), arg("l1"), arg("h2"), arg("k2"), arg("l2"), + arg("Unit") = (int)(angDegrees))) + .def("recVolume", (double (UnitCell::*)() const) & UnitCell::recVolume, arg("self")) + .def("set", (void (UnitCell::*)(double, double, double, double, double, + double, int const)) & + UnitCell::set, + (arg("self"), arg("_a"), arg("_b"), arg("_c"), arg("_alpha"), arg("_beta"), + arg("_gamma"), arg("Unit") = (int)(angDegrees))) + .def("seta", (void (UnitCell::*)(double))(&UnitCell::seta), (arg("self"), arg("_a"))) + .def("setalpha", + (void (UnitCell::*)(double, int const))(&UnitCell::setalpha), + (arg("self"), arg("_alpha"), arg("Unit") = (int)(angDegrees))) + .def("setb", (void (UnitCell::*)(double))(&UnitCell::setb), (arg("self"), arg("_b"))) + .def("setbeta", + (void (UnitCell::*)(double, int const))(&UnitCell::setbeta), + (arg("self"), arg("_beta"), arg("Unit") = (int)(angDegrees))) + .def("setc", (void (UnitCell::*)(double))(&UnitCell::setc), (arg("self"), arg("_c"))) + .def("setgamma", + (void (UnitCell::*)(double, int const))(&UnitCell::setgamma), + (arg("self"), arg("_gamma"), arg("Unit") = (int)(angDegrees))) + .def("setError", (void (UnitCell::*)(double, double, double, double, + double, double, int const)) & + UnitCell::setError, + (arg("self"), arg("_aerr"), arg("_berr"), arg("_cerr"), arg("_alphaerr"), + arg("_betaerr"), arg("_gammaerr"), arg("Unit") = (int)(angDegrees))) + .def("setErrora", (void (UnitCell::*)(double))(&UnitCell::setErrora), + (arg("self"), arg("_aerr"))) + .def("setErroralpha", + (void (UnitCell::*)(double, int const))(&UnitCell::setErroralpha), + (arg("self"), arg("_alphaerr"), arg("Unit") = (int)(angDegrees))) + .def("setErrorb", (void (UnitCell::*)(double))(&UnitCell::setErrorb), + (arg("self"), arg("_berr"))) + .def("setErrorbeta", + (void (UnitCell::*)(double, int const))(&UnitCell::setErrorbeta), + (arg("self"), arg("_betaerr"), arg("Unit") = (int)(angDegrees))) + .def("setErrorc", (void (UnitCell::*)(double))(&UnitCell::setErrorc), + (arg("self"), arg("_cerr"))) + .def("setErrorgamma", + (void (UnitCell::*)(double, int const))(&UnitCell::setErrorgamma), + (arg("self"), arg("_gammaerr"), arg("Unit") = (int)(angDegrees))) + .def("volume", (double (UnitCell::*)() const) & UnitCell::volume, arg("self")) + .def("getG", &UnitCell::getG, arg("self"), return_readonly_numpy()) + .def("getGstar", &UnitCell::getGstar, arg("self"), return_readonly_numpy()) + .def("getB", &UnitCell::getB, arg("self"), return_readonly_numpy()) + .def("recalculateFromGstar", &recalculateFromGstar, + (arg("self"), arg("NewGstar")) + ) + ; scope().attr("deg2rad") = Mantid::Geometry::deg2rad; scope().attr("rad2deg") = Mantid::Geometry::rad2deg; -- GitLab