Skip to content
Snippets Groups Projects
Commit 3e4ff5b2 authored by LINJIAO email's avatar LINJIAO email
Browse files

Refs #13691. Added documenation of parameters for python methods

parent 509c6170
No related merge requests found
Showing
with 317 additions and 222 deletions
......@@ -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");
}
......@@ -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())
;
}
......@@ -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");
}
......@@ -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")));
}
......@@ -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.");
}
......@@ -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");
}
......@@ -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");
}
......@@ -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");
}
......@@ -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.");
}
......@@ -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"
);
}
......@@ -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")
;
}
......@@ -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"));
}
......@@ -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.");
}
......@@ -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");
}
......@@ -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");
}
......@@ -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.");
}
......@@ -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>(),
......
......@@ -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");
}
......
......@@ -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"))
;
}
......@@ -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.")
;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment