9#include <boost/python/class.hpp>
10#include <boost/python/register_ptr_to_python.hpp>
24 PyErr_Warn(PyExc_DeprecationWarning,
"'ICompAssembly.nelements'/'len()' is deprecated in Mantid 7.0, "
25 "use 'ComponentInfo.componentsInSubtree' instead. "
26 "For more information, see the instrument access layers concept page: "
27 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
31std::shared_ptr<IComponent> getItemDeprecated(
const ICompAssembly &self,
const int index) {
32 PyErr_Warn(PyExc_DeprecationWarning,
"'ICompAssembly.__getitem__' is deprecated in Mantid 7.0, "
33 "use 'ComponentInfo.children'/'componentsInSubtree' instead. "
34 "For more information, see the instrument access layers concept page: "
35 "https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
41 register_ptr_to_python<std::shared_ptr<ICompAssembly>>();
43 class_<ICompAssembly, boost::python::bases<IComponent>, boost::noncopyable>(
"ICompAssembly", no_init)
44 .def(
"nelements", &nelementsDeprecated, arg(
"self"),
45 "Returns the number of elements in the assembly "
46 "(deprecated, use ComponentInfo.componentsInSubtree)")
47 .def(
"__len__", &nelementsDeprecated, arg(
"self"),
48 "Returns the number of elements in the assembly "
49 "(deprecated, use ComponentInfo.componentsInSubtree)")
50 .def(
"__getitem__", &getItemDeprecated, (arg(
"self"), arg(
"index")),
51 "Return the component at the given index "
52 "(deprecated, use ComponentInfo.children/componentsInSubtree)");
#define GET_POINTER_SPECIALIZATION(TYPE)
void export_ICompAssembly()
std::map< DeltaEMode::Type, std::string > index
Class for Assembly of geometric components.
virtual int nelements() const =0
Return the number of elements in the assembly.
base class for Geometric IComponent