diff --git a/Framework/PythonInterface/inc/MantidPythonInterface/kernel/StlExportDefinitions.h b/Framework/PythonInterface/inc/MantidPythonInterface/kernel/StlExportDefinitions.h index f02a77e81890363064914c9a3179051a8ffb7ce0..8ec053cc10aed0e6d623729ec609716ac7b5c9be 100644 --- a/Framework/PythonInterface/inc/MantidPythonInterface/kernel/StlExportDefinitions.h +++ b/Framework/PythonInterface/inc/MantidPythonInterface/kernel/StlExportDefinitions.h @@ -35,6 +35,8 @@ #include <vector> #include <set> +using boost::python::arg; + namespace Mantid { namespace PythonInterface { /** @@ -153,19 +155,20 @@ template <typename ElementType> struct std_set_exporter { boost::python::class_<w_t, std::auto_ptr<w_t>>(python_name.c_str()) .def(boost::python::init<w_t const &>()) // special methods - .def("__str__", &std_set_exporter::to_string) - .def("__len__", &w_t::size) - .def("__contains__", contains) - .def("__getitem__", getitem) - .def("__getinitargs__", getinitargs) + .def("__str__", &std_set_exporter::to_string, arg("self")) + .def("__len__", &w_t::size, arg("self")) + .def("__contains__", contains, (arg("self"), arg("element"))) + .def("__getitem__", getitem, (arg("self"), arg("index"))) + .def("__getinitargs__", getinitargs, arg("self")) // Standard methods - .def("size", &w_t::size) - .def("insert", insert_element) - .def("append", insert_element) - .def("insert", insert_set) - .def("extend", insert_set) - .def("erase", (std::size_t (w_t::*)(e_t const &)) & w_t::erase) - .def("clear", &w_t::clear) + .def("size", &w_t::size, arg("self")) + .def("insert", insert_element, (arg("self"), arg("element"))) + .def("append", insert_element, (arg("self"), arg("element"))) + .def("insert", insert_set, (arg("self"), arg("set"))) + .def("extend", insert_set, (arg("self"), arg("set"))) + .def("erase", (std::size_t (w_t::*)(e_t const &)) & w_t::erase, + (arg("self"), arg("index"))) + .def("clear", &w_t::clear, arg("self")) .enable_pickling() ; diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayBoundedValidator.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayBoundedValidator.cpp index 34625d4c7d1ecc8a5990dafa34750de305d1e77c..04d050698f8a9cf2020d253438220c7d3c56bc62 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayBoundedValidator.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayBoundedValidator.cpp @@ -12,26 +12,26 @@ namespace { class_<ArrayBoundedValidator<type>, bases<IValidator>, boost::noncopyable>( \ #prefix "ArrayBoundedValidator") \ .def(init<type, type>( \ - (arg("lowerBound"), arg("upperBound")), \ + (arg("self"), arg("lowerBound"), arg("upperBound")), \ "A validator to ensure each value is in the given range")) \ - .def("hasLower", &ArrayBoundedValidator<type>::hasLower, \ + .def("hasLower", &ArrayBoundedValidator<type>::hasLower, arg("self"), \ "Returns true if a lower bound has been set") \ - .def("hasUpper", &ArrayBoundedValidator<type>::hasUpper, \ + .def("hasUpper", &ArrayBoundedValidator<type>::hasUpper, arg("self"), \ "Returns true if an upper bound has been set") \ - .def("lower", &ArrayBoundedValidator<type>::lower, \ + .def("lower", &ArrayBoundedValidator<type>::lower, arg("self"), \ return_value_policy<copy_const_reference>(), \ "Returns the lower bound") \ - .def("upper", &ArrayBoundedValidator<type>::upper, \ + .def("upper", &ArrayBoundedValidator<type>::upper, arg("self"), \ return_value_policy<copy_const_reference>(), \ "Returns the upper bound") \ .def("setLower", &ArrayBoundedValidator<type>::setLower, \ - "Sets the lower bound") \ + (arg("self"), arg("lower")), "Sets the lower bound") \ .def("setUpper", &ArrayBoundedValidator<type>::setUpper, \ - "Sets the upper bound") \ + (arg("self"), arg("upper")), "Sets the upper bound") \ .def("clearLower", &ArrayBoundedValidator<type>::clearLower, \ - "Clear any set lower bound") \ + arg("self"), "Clear any set lower bound") \ .def("clearUpper", &ArrayBoundedValidator<type>::clearUpper, \ - "Clear any set upper bound"); + arg("self"), "Clear any set upper bound"); } void export_ArrayBoundedValidator() { diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayLengthValidator.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayLengthValidator.cpp index a275edcf7cbd7d2e22a7b6f7c6531dba434a8122..1c405b0a82329d73a07155177f8d132e2285c48d 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayLengthValidator.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayLengthValidator.cpp @@ -12,38 +12,42 @@ namespace { #define EXPORT_LENGTHVALIDATOR(type, prefix) \ class_<ArrayLengthValidator<type>, bases<IValidator>, boost::noncopyable>( \ #prefix "ArrayLengthValidator") \ - .def(init<int>(arg("length"), "Constructs a validator verifying that " \ - "an array is of the exact length given")) \ - .def(init<int, int>((arg("lenmin"), arg("lenmax")), \ + .def(init<int>((arg("self"), arg("length")), \ + "Constructs a validator verifying that " \ + "an array is of the exact length given")) \ + .def(init<int, int>((arg("self"), arg("lenmin"), arg("lenmax")), \ "Constructs a validator verifying that the length " \ "of an array is within the range given")) \ - .def("hasLength", &ArrayLengthValidator<type>::hasLength, \ + .def("hasLength", &ArrayLengthValidator<type>::hasLength, arg("self"), \ "Returns true if a single length has been set") \ .def("hasMinLength", &ArrayLengthValidator<type>::hasMinLength, \ - "Returns true if a minimum length has been set") \ + arg("self"), "Returns true if a minimum length has been set") \ .def("hasMaxLength", &ArrayLengthValidator<type>::hasMaxLength, \ - "Returns true if a maximum length has been set") \ + arg("self"), "Returns true if a maximum length has been set") \ .def("getLength", &ArrayLengthValidator<type>::getLength, \ - return_value_policy<copy_const_reference>(), \ + return_value_policy<copy_const_reference>(), arg("self"), \ "Returns the set fixed length") \ .def("getMinLength", &ArrayLengthValidator<type>::getMinLength, \ - return_value_policy<copy_const_reference>(), \ + return_value_policy<copy_const_reference>(), arg("self"), \ "Returns the set minimum length") \ .def("getMaxLength", &ArrayLengthValidator<type>::getMaxLength, \ - return_value_policy<copy_const_reference>(), \ + return_value_policy<copy_const_reference>(), arg("self"), \ "Returns the set maximum length") \ .def("setLength", &ArrayLengthValidator<type>::setLength, \ + (arg("self"), arg("length")), \ "Set the accepted length of an array") \ .def("clearLength", &ArrayLengthValidator<type>::clearLength, \ - "Clears accepted length of an array") \ + arg("self"), "Clears accepted length of an array") \ .def("setLengthMin", &ArrayLengthValidator<type>::setLengthMin, \ + (arg("self"), arg("minimum length")), \ "Set the accepted minimum length of an array") \ .def("setLengthMax", &ArrayLengthValidator<type>::setLengthMax, \ + (arg("self"), arg("maximum length")), \ "Set the accepted maximum length of an array") \ .def("clearLengthMin", &ArrayLengthValidator<type>::clearLengthMin, \ - "Set the accepted minimum length of an array") \ + arg("self"), "Set the accepted minimum length of an array") \ .def("clearLengthMax", &ArrayLengthValidator<type>::clearLengthMax, \ - "Set the accepted maximum length of an array"); + arg("self"), "Set the accepted maximum length of an array"); } void export_ArrayLengthValidator() { diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayProperty.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayProperty.cpp index 1316a070c69f5ed41ab2510ba1cf5e87d5209747..0a44570ab12ebb2728ead06f93df0c79c704c98d 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayProperty.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayProperty.cpp @@ -30,17 +30,17 @@ typedef return_value_policy<Policies::VectorRefToNumpy<Converters::Clone>> class_<ArrayProperty<type>, bases<PropertyWithValue<std::vector<type>>>, \ boost::noncopyable>(#prefix "ArrayProperty", no_init) \ .def(init<const std::string &, const unsigned int>( \ - (arg("name"), arg("direction") = Direction::Input), \ + (arg("self"), arg("name"), arg("direction") = Direction::Input), \ "Construct an ArrayProperty of type" #type)) \ \ .def(init<const std::string &, IValidator_sptr, const unsigned int>( \ - (arg("name"), arg("validator"), \ + (arg("self"), arg("name"), arg("validator"), \ arg("direction") = Direction::Input), \ "Construct an ArrayProperty of type" #type "with a validator")) \ \ .def(init<const std::string &, const std::string &, IValidator_sptr, \ const unsigned int>( \ - (arg("name"), arg("values"), \ + (arg("self"), arg("name"), arg("values"), \ arg("validator") = IValidator_sptr(new NullValidator), \ arg("direction") = Direction::Input), \ "Construct an ArrayProperty of type" #type \ diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/BoundedValidator.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/BoundedValidator.cpp index ada791077b4c3e5fe554f008ceb14cbc49896776..5aef737a654e84fc3e27b1d69d2519589aae449d 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/BoundedValidator.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/BoundedValidator.cpp @@ -68,34 +68,37 @@ createExclusiveBoundedValidator(object lower = object(), (arg("lower") = object(), arg("upper") = object(), \ arg("exclusive") = false))) \ .def("setLower", &BoundedValidator<ElementType>::setLower, \ - "Set the lower bound") \ + (arg("self"), arg("lower")), "Set the lower bound") \ .def("setUpper", &BoundedValidator<ElementType>::setUpper, \ - "Set the upper bound") \ + (arg("self"), arg("upper")), "Set the upper bound") \ .def("setLowerExclusive", \ &BoundedValidator<ElementType>::setLowerExclusive, \ + (arg("self"), arg("exclusive")), \ "Sets if the lower bound is exclusive") \ .def("setUpperExclusive", \ &BoundedValidator<ElementType>::setUpperExclusive, \ + (arg("self"), arg("exclusive")), \ "Sets if the upper bound is exclsuive") \ .def("setExclusive", &BoundedValidator<ElementType>::setExclusive, \ + (arg("self"), arg("exclusive")), \ "Sets both bounds to be inclusive/exclusive") \ - .def("lower", &BoundedValidator<ElementType>::lower, \ + .def("lower", &BoundedValidator<ElementType>::lower, arg("self"), \ return_value_policy<copy_const_reference>(), \ "Returns the lower bound") \ - .def("upper", &BoundedValidator<ElementType>::upper, \ + .def("upper", &BoundedValidator<ElementType>::upper, arg("self"), \ return_value_policy<copy_const_reference>(), \ "Returns the upper bound") \ .def("setBounds", &BoundedValidator<ElementType>::setBounds, \ - "Set both bounds") \ - .def("hasLower", &BoundedValidator<ElementType>::hasLower, \ + (arg("self"), arg("lower"), arg("upper")), "Set both bounds") \ + .def("hasLower", &BoundedValidator<ElementType>::hasLower, arg("self"), \ "Returns True if a lower bound has been set") \ - .def("hasUpper", &BoundedValidator<ElementType>::hasUpper, \ + .def("hasUpper", &BoundedValidator<ElementType>::hasUpper, arg("self"), \ "Returns True if an upper bound has been set") \ .def("isLowerExclusive", \ - &BoundedValidator<ElementType>::isLowerExclusive, \ + &BoundedValidator<ElementType>::isLowerExclusive, arg("self"), \ "Returns True if the lower bound is exclusive") \ .def("isUpperExclusive", \ - &BoundedValidator<ElementType>::isUpperExclusive, \ + &BoundedValidator<ElementType>::isUpperExclusive, arg("self"), \ "Returns True if the upper bound is exclusive"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/CompositeValidator.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/CompositeValidator.cpp index 83780f72d6a41f262e386eef9018eee819ab7ca6..94f4416922ee772c84d371210918a467694f1e29 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/CompositeValidator.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/CompositeValidator.cpp @@ -40,5 +40,5 @@ void export_CompositeValidator() { .def("add", (void (CompositeValidator::*)(IValidator_sptr)) & CompositeValidator::add, - "Add another validator to the list"); + (arg("self"), arg("other")), "Add another validator to the list"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp index 0798d303ee64747d4d2ea69fce29625f04b81f88..61163771c9d2d3e88a73a25de32ab62e32c6cecb 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp @@ -41,102 +41,117 @@ void export_ConfigService() { std_vector_exporter<FacilityInfo *>::wrap("std_vector_facilityinfo"); class_<ConfigServiceImpl, boost::noncopyable>("ConfigServiceImpl", no_init) - .def("reset", &ConfigServiceImpl::reset, + .def("reset", &ConfigServiceImpl::reset, arg("self"), "Clears all user settings and removes the user properties file") .def("getLocalFilename", &ConfigServiceImpl::getLocalFilename, - "Returns the path to the system wide properties file.") + arg("self"), "Returns the path to the system wide properties file.") - .def("getUserFilename", &ConfigServiceImpl::getUserFilename, + .def("getUserFilename", &ConfigServiceImpl::getUserFilename, arg("self"), "Returns the path to the user properties file") .def("getInstrumentDirectory", &ConfigServiceImpl::getInstrumentDirectory, + arg("self"), "Returns the directory used for the instrument definitions") .def("getInstrumentDirectories", - &ConfigServiceImpl::getInstrumentDirectories, + &ConfigServiceImpl::getInstrumentDirectories, arg("self"), return_value_policy<reference_existing_object>(), "Returns the list of directories searched for the instrument " "definitions") .def("getFacilityNames", &ConfigServiceImpl::getFacilityNames, - "Returns the default facility") + arg("self"), "Returns the default facility") - .def("getFacilities", &ConfigServiceImpl::getFacilities, + .def("getFacilities", &ConfigServiceImpl::getFacilities, arg("self"), "Returns the default facility") .def("getFacility", (const FacilityInfo &(ConfigServiceImpl::*)() const) & ConfigServiceImpl::getFacility, - return_value_policy<reference_existing_object>(), + arg("self"), return_value_policy<reference_existing_object>(), "Returns the default facility") .def("getFacility", (const FacilityInfo &(ConfigServiceImpl::*)(const std::string &) const) & ConfigServiceImpl::getFacility, - (arg("facilityName")), + (arg("self"), arg("facilityName")), return_value_policy<reference_existing_object>(), "Returns the named facility. Raises an RuntimeError if it does not " "exist") .def("setFacility", &ConfigServiceImpl::setFacility, + (arg("self"), arg("facilityName")), "Sets the current facility to the given name") .def("updateFacilities", &ConfigServiceImpl::updateFacilities, + (arg("self"), arg("fileName")), "Loads facility information from a provided file") .def("getInstrument", &ConfigServiceImpl::getInstrument, getInstrument_Overload( "Returns the named instrument. If name = \"\" then the " "default.instrument is returned", - (arg("instrumentName") = + (arg("self"), + arg("instrumentName") = ""))[return_value_policy<copy_const_reference>()]) .def("getString", &ConfigServiceImpl::getString, - getString_Overload("Returns the named key's value. If use_cache = " - "true [default] then relative paths->absolute", - (arg("key"), arg("use_cache") = true))) + getString_Overload( + "Returns the named key's value. If use_cache = " + "true [default] then relative paths->absolute", + (arg("self"), arg("key"), arg("use_cache") = true))) .def("setString", &ConfigServiceImpl::setString, + (arg("self"), arg("key"), arg("value")), "Set the given property name. " "If it does not exist it is added to the current configuration") - .def("hasProperty", &ConfigServiceImpl::hasProperty) + .def("hasProperty", &ConfigServiceImpl::hasProperty, + (arg("self"), arg("rootName"))) .def("getDataSearchDirs", &ConfigServiceImpl::getDataSearchDirs, - return_value_policy<copy_const_reference>(), + arg("self"), return_value_policy<copy_const_reference>(), "Return the current list of data search paths") .def("appendDataSearchDir", &ConfigServiceImpl::appendDataSearchDir, + (arg("self"), arg("path")), "Append a directory to the current list of data search paths") .def("setDataSearchDirs", (void (ConfigServiceImpl::*)(const std::string &)) & ConfigServiceImpl::setDataSearchDirs, + (arg("self"), arg("searchDirs")), "Set the whole datasearch.directories property from a single " "string. Entries should be separated by a ; character") .def("setDataSearchDirs", &setDataSearchDirs, + (arg("self"), arg("searchDirs")), "Set the datasearch.directories property from a list of strings.") .def("saveConfig", &ConfigServiceImpl::saveConfig, + (arg("self"), arg("filename")), "Saves the keys that have changed from their default to the given " "filename") .def("setFileLogLevel", &ConfigServiceImpl::setFileLogLevel, - "Sets the log level priority for the File log channel, logLevel 1 = " - "Fatal, 6 = information, 7 = Debug") + (arg("self"), arg("logLevel")), "Sets the log level priority for " + "the File log channel, logLevel 1 = " + "Fatal, 6 = information, 7 = Debug") .def("setConsoleLogLevel", &ConfigServiceImpl::setConsoleLogLevel, + (arg("self"), arg("logLevel")), "Sets the log level priority for the Console log channel, logLevel " "1 = Fatal, 6 = information, 7 = Debug") - .def("keys", &ConfigServiceImpl::keys) + .def("keys", &ConfigServiceImpl::keys, arg("self")) // Treat this as a dictionary - .def("__getitem__", &getStringUsingCache) - .def("__setitem__", &ConfigServiceImpl::setString) - .def("__contains__", &ConfigServiceImpl::hasProperty) + .def("__getitem__", &getStringUsingCache, (arg("self"), arg("key"))) + .def("__setitem__", &ConfigServiceImpl::setString, + (arg("self"), arg("key"), arg("value"))) + .def("__contains__", &ConfigServiceImpl::hasProperty, + (arg("self"), arg("key"))) .def("Instance", &ConfigService::Instance, return_value_policy<reference_existing_object>(), "Returns a reference to the ConfigService") diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/DataItem.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/DataItem.cpp index d9bc41f197f3602d975b346075e3f9841cf79ccf..00138aa8bb7557bd71cf8b05bb29e429f9c7556e 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/DataItem.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/DataItem.cpp @@ -10,13 +10,14 @@ void export_DataItem() { register_ptr_to_python<boost::shared_ptr<DataItem>>(); class_<DataItem, boost::noncopyable>("DataItem", no_init) - .def("id", &DataItem::id, "The string ID of the class") - .def("name", &DataItem::name, "The name of the object") - .def("threadSafe", &DataItem::threadSafe, "Returns true if the object " - "can be accessed safely from " - "multiple threads") - .def("__str__", &DataItem::name, + .def("id", &DataItem::id, arg("self"), "The string ID of the class") + .def("name", &DataItem::name, arg("self"), "The name of the object") + .def("threadSafe", &DataItem::threadSafe, arg("self"), + "Returns true if the object " + "can be accessed safely from " + "multiple threads") + .def("__str__", &DataItem::name, arg("self"), "Returns the string name of the object if it has been stored") - .def("__repr__", &DataItem::toString, + .def("__repr__", &DataItem::toString, arg("self"), "Returns a description of the object"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/DateAndTime.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/DateAndTime.cpp index 89e35bf42b13ab837f83f58986d79e16f39ecbb1..4928393000b1b61d19e99d649308dca8a408f8f2 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/DateAndTime.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/DateAndTime.cpp @@ -5,6 +5,7 @@ using Mantid::Kernel::DateAndTime; using Mantid::Kernel::time_duration; using namespace boost::python; +using boost::python::arg; /** Circumvent a bug in IPython 1.1, which chokes on nanosecond precision * datetimes. @@ -19,17 +20,21 @@ std::string ISO8601StringPlusSpace(DateAndTime &self) { void export_DateAndTime() { class_<DateAndTime>("DateAndTime", no_init) // Constructors - .def(init<const std::string>("Construct from an ISO8601 string")) + .def(init<const std::string>((arg("self"), arg("ISO8601 string")), + "Construct from an ISO8601 string")) .def(init<double, double>( + (arg("self"), arg("seconds"), arg("nanoseconds")), "Construct using a number of seconds and nanoseconds (floats)")) .def(init<int64_t, int64_t>( + (arg("self"), arg("seconds"), arg("nanoseconds")), "Construct using a number of seconds and nanoseconds (integers)")) - .def(init<int64_t>("Construct a total number of nanoseconds")) - .def("total_nanoseconds", &DateAndTime::totalNanoseconds) - .def("totalNanoseconds", &DateAndTime::totalNanoseconds) - .def("setToMinimum", &DateAndTime::setToMinimum) - .def("__str__", &ISO8601StringPlusSpace) - .def("__long__", &DateAndTime::totalNanoseconds) + .def(init<int64_t>((arg("self"), arg("total nanoseconds")), + "Construct a total number of nanoseconds")) + .def("total_nanoseconds", &DateAndTime::totalNanoseconds, arg("self")) + .def("totalNanoseconds", &DateAndTime::totalNanoseconds, arg("self")) + .def("setToMinimum", &DateAndTime::setToMinimum, arg("self")) + .def("__str__", &ISO8601StringPlusSpace, arg("self")) + .def("__long__", &DateAndTime::totalNanoseconds, arg("self")) .def(self == self) .def(self != self) // cppcheck-suppress duplicateExpression @@ -43,22 +48,24 @@ void export_DateAndTime() { void export_time_duration() { class_<time_duration>("time_duration", no_init) - .def("hours", &time_duration::hours, + .def("hours", &time_duration::hours, arg("self"), "Returns the normalized number of hours") - .def("minutes", &time_duration::minutes, + .def("minutes", &time_duration::minutes, arg("self"), "Returns the normalized number of minutes +/-(0..59)") - .def("seconds", &time_duration::seconds, + .def("seconds", &time_duration::seconds, arg("self"), "Returns the normalized number of seconds +/-(0..59)") - .def("total_seconds", &time_duration::total_seconds, + .def("total_seconds", &time_duration::total_seconds, arg("self"), "Get the total number of seconds truncating any fractional seconds") .def("total_milliseconds", &time_duration::total_milliseconds, + arg("self"), "Get the total number of milliseconds truncating any remaining " "digits") .def("total_microseconds", &time_duration::total_microseconds, + arg("self"), "Get the total number of microseconds truncating any remaining " "digits") .def( - "total_nanoseconds", &time_duration::total_nanoseconds, + "total_nanoseconds", &time_duration::total_nanoseconds, arg("self"), "Get the total number of nanoseconds truncating any remaining digits") ; diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/DeltaEMode.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/DeltaEMode.cpp index 981ff7c54407f79e6b685664d118cf2be0c7209f..e3148bede17616f65de8dfa5494dc590a4beb101 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/DeltaEMode.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/DeltaEMode.cpp @@ -17,9 +17,9 @@ void export_DeltaEMode() { .export_values(); class_<DeltaEMode, boost::noncopyable>("DeltaEMode", no_init) - .def("asString", &DeltaEMode::asString, + .def("asString", &DeltaEMode::asString, arg("self"), "Returns the given type translated to a string") - .def("fromString", &DeltaEMode::fromString, + .def("fromString", &DeltaEMode::fromString, arg("modeStr"), "Returns the enumerated type translated from a string") .def("availableTypes", &DeltaEMode::availableTypes, return_value_policy<Policies::VectorToNumpy>(), diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/EnabledWhenProperty.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/EnabledWhenProperty.cpp index 32066286b3c981d1468a5d81ff13daba4c244206..9982028e943d1892288b44e4dc7eb4b9b8f38b32 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/EnabledWhenProperty.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/EnabledWhenProperty.cpp @@ -18,12 +18,12 @@ void export_EnabledWhenProperty() { "EnabledWhenProperty", no_init) // no default constructor .def(init<std::string, ePropertyCriterion, std::string>( - (arg("otherPropName"), arg("when"), arg("value")), + (arg("self"), arg("otherPropName"), arg("when"), arg("value")), "Enabled otherPropName property when value criterion meets that " "given by the 'when' argument")) .def(init<std::string, ePropertyCriterion>( - (arg("otherPropName"), arg("when")), + (arg("self"), arg("otherPropName"), arg("when")), "Enabled otherPropName property when criterion does not require a " "value, i.e isDefault")); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/FacilityInfo.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/FacilityInfo.cpp index e250fc97f7fca21f470c4b50c6ace25bb113862f..907c51778cf610aba31d1a672e6df9a6a320a04e 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/FacilityInfo.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/FacilityInfo.cpp @@ -13,56 +13,58 @@ void export_FacilityInfo() { class_<FacilityInfo>("FacilityInfo", no_init) - .def("name", &FacilityInfo::name, + .def("name", &FacilityInfo::name, arg("self"), return_value_policy<copy_const_reference>(), "Returns name of the facility as definined in the Facilities.xml " "file") - .def("__str__", &FacilityInfo::name, + .def("__str__", &FacilityInfo::name, arg("self"), return_value_policy<copy_const_reference>(), "Returns name of the facility as definined in the Facilities.xml " "file") - .def("zeroPadding", &FacilityInfo::zeroPadding, + .def("zeroPadding", &FacilityInfo::zeroPadding, arg("self"), "Returns default zero padding for this facility") - .def("delimiter", &FacilityInfo::delimiter, + .def("delimiter", &FacilityInfo::delimiter, arg("self"), return_value_policy<copy_const_reference>(), "Returns the delimiter between the instrument name and the run " "number.") - .def("extensions", &FacilityInfo::extensions, + .def("extensions", &FacilityInfo::extensions, arg("self"), "Returns the list of file extensions that are considered as " "instrument data files.") - .def("preferredExtension", &FacilityInfo::preferredExtension, + .def("preferredExtension", &FacilityInfo::preferredExtension, arg("self"), return_value_policy<copy_const_reference>(), "Returns the extension that is preferred for this facility") - .def("archiveSearch", &FacilityInfo::archiveSearch, + .def("archiveSearch", &FacilityInfo::archiveSearch, arg("self"), return_value_policy<copy_const_reference>(), "Return the archive search interface names") .def("instruments", (const std::vector<InstrumentInfo> &(FacilityInfo::*)() const) & FacilityInfo::instruments, - return_value_policy<copy_const_reference>(), + arg("self"), return_value_policy<copy_const_reference>(), "Returns a list of instruments of this facility as defined in the " "Facilities.xml file") .def("instruments", (std::vector<InstrumentInfo>( FacilityInfo::*)(const std::string &) const) & FacilityInfo::instruments, + (arg("self"), arg("technique")), "Returns a list of instruments of given technique") .def("instrument", &FacilityInfo::instrument, + (arg("self"), arg("instrumentName")), return_value_policy<copy_const_reference>(), "Returns the instrument with the given name") - .def("liveListener", &FacilityInfo::liveListener, + .def("liveListener", &FacilityInfo::liveListener, arg("self"), return_value_policy<copy_const_reference>(), "Returns the name of the default live listener") - .def("computeResources", &FacilityInfo::computeResources, + .def("computeResources", &FacilityInfo::computeResources, arg("self"), "Returns a vector of the available compute resources"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/FilteredTimeSeriesProperty.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/FilteredTimeSeriesProperty.cpp index fc543101449c48e50a06c5bbfbaab9b53b9fc271..dcf283dbc0448b16201f5058ef507836cec2488a 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/FilteredTimeSeriesProperty.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/FilteredTimeSeriesProperty.cpp @@ -19,10 +19,11 @@ namespace { class_<FilteredTimeSeriesProperty<TYPE>, bases<TimeSeriesProperty<TYPE>>, \ boost::noncopyable>(#Prefix "FilteredTimeSeriesProperty", no_init) \ .def(init<TimeSeriesProperty<TYPE> *, const TimeSeriesProperty<bool> &, \ - const bool>("Constructor", (arg("source"), arg("filter"), \ - arg("transferOwner")))) \ + const bool>( \ + "Constructor", \ + (arg("self"), arg("source"), arg("filter"), arg("transferOwner")))) \ .def("unfiltered", &FilteredTimeSeriesProperty<TYPE>::unfiltered, \ - return_value_policy<RemoveConst>(), \ + (arg("self")), return_value_policy<RemoveConst>(), \ "Returns a time series containing the unfiltered data"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertyManager.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertyManager.cpp index 6d95138c3c6571b6393ba45ed621e5a80e8f27fc..c1ff7244e8324999b904c3ed2a66dfde8be51dab 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertyManager.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertyManager.cpp @@ -111,65 +111,69 @@ void export_IPropertyManager() { register_ptr_to_python<IPropertyManager *>(); class_<IPropertyManager, boost::noncopyable>("IPropertyManager", no_init) - .def("propertyCount", &IPropertyManager::propertyCount, args("self"), + .def("propertyCount", &IPropertyManager::propertyCount, arg("self"), "Returns the number of properties being managed") .def("getProperty", &IPropertyManager::getPointerToProperty, - args("self", "name"), return_value_policy<return_by_value>(), + (arg("self"), arg("name")), return_value_policy<return_by_value>(), "Returns the property of the given name. Use .value to give the " "value") .def("getPropertyValue", &IPropertyManager::getPropertyValue, - args("self", "name"), + (arg("self"), arg("name")), "Returns a string representation of the named property's value") - .def("getProperties", &IPropertyManager::getProperties, args("self"), + .def("getProperties", &IPropertyManager::getProperties, arg("self"), return_value_policy<copy_const_reference>(), "Returns the list of properties managed by this object") - .def("declareProperty", &declareProperty, args("self", "name", "value"), + .def("declareProperty", &declareProperty, + (arg("self"), arg("name"), arg("value")), "Create a new named property") .def("setPropertyValue", &IPropertyManager::setPropertyValue, - args("self", "name", "value"), + (arg("self"), arg("name"), arg("value")), "Set the value of the named property via a string") - .def("setProperty", &setProperty, args("self", "name", "value"), + .def("setProperty", &setProperty, + (arg("self"), arg("name"), arg("value")), "Set the value of the named property") .def("setPropertySettings", &setPropertySettings, - args("self", "name", "settingsManager"), + (arg("self"), arg("name"), arg("settingsManager")), "Assign the given IPropertySettings object to the named property") .def("setPropertyGroup", &IPropertyManager::setPropertyGroup, - args("self", "name", "group"), "Set the group for a given property") + (arg("self"), arg("name"), arg("group")), + "Set the group for a given property") .def("existsProperty", &IPropertyManager::existsProperty, - args("self", "name"), "Returns whether a property exists") + (arg("self"), arg("name")), "Returns whether a property exists") // Special methods so that IPropertyManager acts like a dictionary // __len__, __getitem__, __setitem__, __delitem__, __iter__ and // __contains__ - .def("__len__", &IPropertyManager::propertyCount, args("self"), + .def("__len__", &IPropertyManager::propertyCount, arg("self"), "Returns the number of properties being managed") .def("__getitem__", &IPropertyManager::getPointerToProperty, - args("self", "name"), return_value_policy<return_by_value>(), + (arg("self"), arg("name")), return_value_policy<return_by_value>(), "Returns the property of the given name. Use .value to give the " "value") - .def("__setitem__", &declareOrSetProperty, args("self", "name", "value"), + .def("__setitem__", &declareOrSetProperty, + (arg("self"), arg("name"), arg("value")), "Set the value of the named property or create it if it doesn't " "exist") - .def("__delitem__", &deleteProperty, args("self", "name"), + .def("__delitem__", &deleteProperty, (arg("self"), arg("name")), "Delete the named property") // TODO .def("__iter__", iterator<std::vector<std::string> > ()) .def("__contains__", &IPropertyManager::existsProperty, - args("self", "name"), "Returns whether a property exists") + (arg("self"), arg("name")), "Returns whether a property exists") // Bonus methods to be even more like a dict - .def("has_key", &IPropertyManager::existsProperty, args("self", "name"), - "Returns whether a property exists") - .def("keys", &getKeys, args("self")) - .def("values", &IPropertyManager::getProperties, args("self"), + .def("has_key", &IPropertyManager::existsProperty, + (arg("self"), arg("name")), "Returns whether a property exists") + .def("keys", &getKeys, arg("self")) + .def("values", &IPropertyManager::getProperties, arg("self"), return_value_policy<copy_const_reference>(), "Returns the list of properties managed by this object"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertySettings.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertySettings.cpp index 0cb00ba141e633c59b91a6642f84425371fb5e0c..fd960fc825ee672f356b8e749aaf328be27b2c69 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertySettings.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertySettings.cpp @@ -11,8 +11,10 @@ void export_IPropertySettings() { class_<IPropertySettings, boost::noncopyable>("IPropertySettings", no_init) .def("isEnabled", &IPropertySettings::isEnabled, + (arg("self"), arg("alg")), "Is the property to be shown as enabled in the GUI. Default true.") .def("isVisible", &IPropertySettings::isVisible, + (arg("self"), arg("alg")), "Is the property to be shown in the GUI? Default true."); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/InstrumentInfo.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/InstrumentInfo.cpp index 6d11545e04e9fd70d1322f49cd3c7a4c72998c7a..d72da5eea64e8dc3adddb0ec6e846008889996a8 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/InstrumentInfo.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/InstrumentInfo.cpp @@ -12,38 +12,41 @@ void export_InstrumentInfo() { std_vector_exporter<InstrumentInfo>::wrap("std_vector_InstrumentInfo"); class_<InstrumentInfo>("InstrumentInfo", no_init) - .def("name", &InstrumentInfo::name, + .def("name", &InstrumentInfo::name, arg("self"), "" "Returns the full name of the instrument as defined in the " "Facilites.xml file") - .def("shortName", &InstrumentInfo::shortName, + .def("shortName", &InstrumentInfo::shortName, arg("self"), "Returns the abbreviated name of the instrument as definined in the " "Facilites.xml file") - .def("__str__", &InstrumentInfo::shortName, + .def("__str__", &InstrumentInfo::shortName, arg("self"), "Returns the abbreviated name of the instrument as definined in the " "Facilites.xml file") .def("zeroPadding", &InstrumentInfo::zeroPadding, + (arg("self"), arg("runNumber")), "Returns zero padding for this instrument") .def("filePrefix", &InstrumentInfo::filePrefix, + (arg("self"), arg("runNumber")), "Returns file prefix for this instrument") - .def("delimiter", &InstrumentInfo::delimiter, "Returns the delimiter " - "between the instrument " - "name and the run number.") + .def("delimiter", &InstrumentInfo::delimiter, arg("self"), + "Returns the delimiter " + "between the instrument " + "name and the run number.") - .def("techniques", &InstrumentInfo::techniques, + .def("techniques", &InstrumentInfo::techniques, arg("self"), return_value_policy<copy_const_reference>(), "Return list of techniques this instrument supports") - .def("facility", &InstrumentInfo::facility, + .def("facility", &InstrumentInfo::facility, arg("self"), return_value_policy<copy_const_reference>(), "Returns the facility that contains this instrument.") - .def("instdae", &InstrumentInfo::liveDataAddress, + .def("instdae", &InstrumentInfo::liveDataAddress, arg("self"), return_value_policy<copy_const_reference>(), "Returns the host name and the port of the machine hosting DAE and " "providing port to connect to for a live data stream") diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/ListValidator.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/ListValidator.cpp index 75c2ae54ac615913071285c7dc662c2554369922..d13676fc3f7917019aac076cd0c6daa88a08e5f2 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/ListValidator.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/ListValidator.cpp @@ -35,6 +35,7 @@ createListValidator(const boost::python::list &allowedValues) { make_constructor(&createListValidator<type>, \ default_call_policies(), arg("allowedValues"))) \ .def("addAllowedValue", &ListValidator<type>::addAllowedValue, \ + (arg("self"), arg("value")), \ "Adds a value to the list of accepted values"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/LogFilter.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/LogFilter.cpp index 89f9e7e29a98e6e89637ec0f45c5712be655f2a4..4a8b24348cd44569214bdd954ddeb8db54a5ee78 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/LogFilter.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/LogFilter.cpp @@ -11,10 +11,12 @@ using namespace boost::python; void export_LogFilter() { class_<LogFilter, boost::noncopyable>( "LogFilter", init<const Property *>( + (arg("self"), arg("property")), "Creates a log filter using the log to be filtered")) - .def("data", &LogFilter::data, return_value_policy<return_by_value>(), + .def("data", &LogFilter::data, arg("self"), + return_value_policy<return_by_value>(), "Returns a time series property filtered on current filter property") - .def("addFilter", &LogFilter::addFilter, + .def("addFilter", &LogFilter::addFilter, (arg("self"), arg("filter")), "Adds a filter to the current list"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/Logger.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/Logger.cpp index 40d5a9c310f0b72fe6056a1cc90f53840a12882c..8494bdcd5fce1ec6680049775a0b6d5c466420bb 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/Logger.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/Logger.cpp @@ -25,28 +25,35 @@ void export_Logger() { // To distinguish between the overloaded functions typedef void (Logger::*LogLevelFunction)(const std::string &); - class_<Logger, boost::noncopyable>("Logger", init<std::string>(arg("name"))) + class_<Logger, boost::noncopyable>( + "Logger", init<std::string>((arg("self"), arg("name")))) .def("fatal", (LogLevelFunction)&Logger::fatal, + (arg("self"), arg("message")), "Send a message at fatal priority: " "An unrecoverable error has occured and the application will " "terminate") .def("error", (LogLevelFunction)&Logger::error, + (arg("self"), arg("message")), "Send a message at error priority: " "An error has occured but the framework is able to handle it and " "continue") .def("warning", (LogLevelFunction)&Logger::warning, + (arg("self"), arg("message")), "Send a message at warning priority: " "Something was wrong but the framework was able to continue despite " "the problem.") .def("notice", (LogLevelFunction)&Logger::notice, + (arg("self"), arg("message")), "Sends a message at notice priority: " "Really important information that should be displayed to the user, " "this should be minimal. The default logging level is set here " "unless it is altered.") .def("information", (LogLevelFunction)&Logger::information, + (arg("self"), arg("message")), "Send a message at information priority: " "Useful but not vital information to be relayed back to the user.") .def("debug", (LogLevelFunction)&Logger::debug, + (arg("self"), arg("message")), "Send a message at debug priority:" ". Anything that may be useful to understand what the code has been " "doing for debugging purposes.") diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/Material.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/Material.cpp index 36ee205659c6535475e268471bead2bbb0442b8e..5928f46115c8e5d58263a3324306403c9e23d6b3 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/Material.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/Material.cpp @@ -14,8 +14,8 @@ void export_Material() { register_ptr_to_python<boost::shared_ptr<Material>>(); class_<Material, boost::noncopyable>("Material", no_init) - .def("name", &Material::name, return_value_policy<copy_const_reference>(), - "Name of the material") + .def("name", &Material::name, arg("self"), + return_value_policy<copy_const_reference>(), "Name of the material") .add_property("numberDensity", make_function(&Material::numberDensity), "Number density") .add_property("temperature", make_function(&Material::temperature), @@ -23,18 +23,18 @@ void export_Material() { .add_property("pressure", make_function(&Material::pressure), "Pressure") .def("cohScatterXSection", (double (Material::*)(double) const)(&Material::cohScatterXSection), - (arg("lambda") = (double)NeutronAtom::ReferenceLambda), + (arg("self"), arg("lambda") = (double)NeutronAtom::ReferenceLambda), "Coherent Scattering Cross-Section") .def("incohScatterXSection", (double (Material::*)(double) const)(&Material::incohScatterXSection), - (arg("lambda") = (double)NeutronAtom::ReferenceLambda), + (arg("self"), arg("lambda") = (double)NeutronAtom::ReferenceLambda), "Incoherent Scattering Cross-Section") .def("totalScatterXSection", (double (Material::*)(double) const)(&Material::totalScatterXSection), - (arg("lambda") = (double)NeutronAtom::ReferenceLambda), + (arg("self"), arg("lambda") = (double)NeutronAtom::ReferenceLambda), "Total Scattering Cross-Section") .def("absorbXSection", (double (Material::*)(double) const)(&Material::absorbXSection), - (arg("lambda") = (double)NeutronAtom::ReferenceLambda), + (arg("self"), arg("lambda") = (double)NeutronAtom::ReferenceLambda), "Absorption Cross-Section"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/Memory.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/Memory.cpp index 46aad239e32e0b3cebd83ae3ca11ca510013c9b5..a3bcdc1420274326010e8d42717fd136c4a8d160 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/Memory.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/Memory.cpp @@ -6,14 +6,15 @@ using namespace boost::python; void export_MemoryStats() { - class_<MemoryStats>("MemoryStats", init<>("Construct MemoryStats object.")) - .def("update", &MemoryStats::update, args("self")) - .def("totalMem", &MemoryStats::totalMem, args("self")) - .def("availMem", &MemoryStats::availMem, args("self")) - .def("residentMem", &MemoryStats::residentMem, args("self")) - .def("virtualMem", &MemoryStats::virtualMem, args("self")) - .def("reservedMem", &MemoryStats::reservedMem, args("self")) - .def("getFreeRatio", &MemoryStats::getFreeRatio, args("self")) - .def("getCurrentRSS", &MemoryStats::getCurrentRSS, args("self")) - .def("getPeakRSS", &MemoryStats::getPeakRSS, args("self")); + class_<MemoryStats>("MemoryStats", + init<>(arg("self"), "Construct MemoryStats object.")) + .def("update", &MemoryStats::update, arg("self")) + .def("totalMem", &MemoryStats::totalMem, arg("self")) + .def("availMem", &MemoryStats::availMem, arg("self")) + .def("residentMem", &MemoryStats::residentMem, arg("self")) + .def("virtualMem", &MemoryStats::virtualMem, arg("self")) + .def("reservedMem", &MemoryStats::reservedMem, arg("self")) + .def("getFreeRatio", &MemoryStats::getFreeRatio, arg("self")) + .def("getCurrentRSS", &MemoryStats::getCurrentRSS, arg("self")) + .def("getPeakRSS", &MemoryStats::getPeakRSS, arg("self")); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/ProgressBase.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/ProgressBase.cpp index 20b0764a66dcdc8dd73531372150a68aa9027c93..0dcef5d1d7e65df2895e25f7f5346f9a00fd0039 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/ProgressBase.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/ProgressBase.cpp @@ -7,35 +7,41 @@ using namespace boost::python; void export_ProgressBase() { class_<ProgressBase, boost::noncopyable>("ProgressBase", no_init) .def("report", (void (ProgressBase::*)()) & ProgressBase::report, + arg("self"), "Increment the progress by 1 and report with no message") .def("report", (void (ProgressBase::*)(const std::string &)) & ProgressBase::report, - (arg("msg")), "Increment the progress by 1 and report along with " - "the given message") + (arg("self"), arg("msg")), + "Increment the progress by 1 and report along with " + "the given message") .def("report", (void (ProgressBase::*)(int64_t, const std::string &)) & ProgressBase::report, - (arg("i"), arg("msg")), "Set the progress to given amount and " - "report along with the given message") + (arg("self"), arg("i"), arg("msg")), + "Set the progress to given amount and " + "report along with the given message") .def("reportIncrement", (void (ProgressBase::*)(size_t, const std::string &)) & ProgressBase::reportIncrement, - (arg("i"), arg("msg")), "Increment the progress by given amount and " - "report along with the given message") + (arg("self"), arg("i"), arg("msg")), + "Increment the progress by given amount and " + "report along with the given message") - .def("setNumSteps", &ProgressBase::setNumSteps, (arg("nsteps")), + .def("setNumSteps", &ProgressBase::setNumSteps, + (arg("self"), arg("nsteps")), "Sets a new number of steps for the current progress range") .def("resetNumSteps", &ProgressBase::resetNumSteps, - (arg("nsteps"), arg("start"), arg("end")), + (arg("self"), arg("nsteps"), arg("start"), arg("end")), "Resets the number of steps & progress range to the given values") - .def("setNotifyStep", &ProgressBase::setNotifyStep, (arg("notifyStep")), + .def("setNotifyStep", &ProgressBase::setNotifyStep, + (arg("self"), arg("notifyStep")), "Set how often the notifications are actually reported") - .def("getEstimatedTime", &ProgressBase::getEstimatedTime, + .def("getEstimatedTime", &ProgressBase::getEstimatedTime, arg("self"), "Returns an estimate of the time remaining. May not be to accurate " "if the reporting is lumpy."); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/PropertyHistory.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/PropertyHistory.cpp index 1459fee276c6ea112d01a47bfb4bb7e600d385a0..b373cd85709094ce91c42507fab412c66e54a5fe 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/PropertyHistory.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/PropertyHistory.cpp @@ -14,22 +14,22 @@ void export_PropertyHistory() { class_<PropertyHistory>("PropertyHistory", no_init) - .def("name", &PropertyHistory::name, + .def("name", &PropertyHistory::name, arg("self"), return_value_policy<copy_const_reference>(), "Returns the name of the property.") - .def("value", &PropertyHistory::value, + .def("value", &PropertyHistory::value, arg("self"), return_value_policy<copy_const_reference>(), "Returns the value of the property.") - .def("type", &PropertyHistory::type, + .def("type", &PropertyHistory::type, arg("self"), return_value_policy<copy_const_reference>(), "Returns the type of the property.") - .def("isDefault", &PropertyHistory::isDefault, + .def("isDefault", &PropertyHistory::isDefault, arg("self"), "Returns if the property value is the default value.") - .def("direction", &PropertyHistory::direction, + .def("direction", &PropertyHistory::direction, arg("self"), "Returns the direction of the property.") // ----------------- Operators -------------------------------------- .def(self_ns::str(self)); diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/Quat.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/Quat.cpp index 03d71fc376c4d774f2243b8f51f323a2a663694b..abcba6155a2a13b3dc1a9a711887e3754578a120 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/Quat.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/Quat.cpp @@ -5,11 +5,11 @@ #include <boost/python/copy_const_reference.hpp> #include <boost/python/register_ptr_to_python.hpp> #include <boost/python/return_value_policy.hpp> +#include <boost/python/return_arg.hpp> using Mantid::Kernel::Quat; using Mantid::Kernel::V3D; - -using boost::python::args; +using boost::python::arg; using boost::python::init; using boost::python::class_; using boost::python::self; @@ -28,43 +28,49 @@ void export_Quat() { "Quaternions are used for roations in 3D spaces and often " "implemented for " "computer graphics applications.", - init<>(args("self"), + init<>(arg("self"), "Construct a default Quat that will perform no transformation.")) .def(init<double, double, double, double>( - args("self", "w", "a", "b", "c"), "Constructor with values")) - .def(init<V3D, V3D>(args("self", "src", "dest"), + (arg("self"), arg("w"), arg("a"), arg("b"), arg("c")), + "Constructor with values")) + .def(init<V3D, V3D>((arg("self"), arg("src"), arg("dest")), "Construct a Quat between two vectors")) - .def(init<V3D, V3D, V3D>(args("self", "rX", "rY", "rZ"), + .def(init<V3D, V3D, V3D>((arg("self"), arg("rX"), arg("rY"), arg("rZ")), "Construct a Quaternion that performs a " "reference frame rotation.\nThe initial X,Y,Z " "vectors are aligned as expected: X=(1,0,0), " "Y=(0,1,0), Z=(0,0,1)")) - .def(init<double, V3D>(args("self", "deg", "axis"), + .def(init<double, V3D>((arg("self"), arg("deg"), arg("axis")), "Constructor from an angle(degrees) and an axis.")) - .def("rotate", &Quat::rotate, args("self", "v"), + .def("rotate", &Quat::rotate, (arg("self"), arg("v")), "Rotate the quaternion by the given vector") - .def("real", &Quat::real, args("self"), + .def("real", &Quat::real, arg("self"), "Returns the real part of the quaternion") - .def("imagI", &Quat::imagI, args("self"), + .def("imagI", &Quat::imagI, arg("self"), "Returns the ith imaginary component") - .def("imagJ", &Quat::imagJ, args("self"), + .def("imagJ", &Quat::imagJ, arg("self"), "Returns the jth imaginary component") - .def("imagK", &Quat::imagK, args("self"), + .def("imagK", &Quat::imagK, arg("self"), "Returns the kth imaginary component") - .def("len", &Quat::len, args("self"), + .def("len", &Quat::len, arg("self"), "Returns the 'length' of the quaternion") - .def("len2", &Quat::len2, args("self"), + .def("len2", &Quat::len2, arg("self"), "Returns the square of the 'length' of the quaternion") - .def(self + self) - .def(self += self) - .def(self - self) - .def(self -= self) - .def(self * self) - .def(self *= self) - .def(self == self) - .def(self != self) + .def("__add__", &Quat::operator+, (arg("left"), arg("right"))) + .def("__iadd__", &Quat::operator+=, boost::python::return_self<>(), + (arg("self"), arg("other"))) + .def("__sub__", &Quat::operator-, (arg("left"), arg("right"))) + .def("__isub__", &Quat::operator-=, boost::python::return_self<>(), + (arg("self"), arg("other"))) + .def("__mul__", &Quat::operator*, (arg("left"), arg("right"))) + .def("__imul__", &Quat::operator*=, boost::python::return_self<>(), + (arg("self"), arg("other"))) + .def("__eq__", &Quat::operator==, (arg("self"), arg("other"))) + .def("__ne__", &Quat::operator!=, (arg("self"), arg("other"))) .def("__getitem__", (const double &(Quat::*)(int) const) & Quat::operator[], - return_value_policy<copy_const_reference>()) - .def(boost::python::self_ns::str(self)); + return_value_policy<copy_const_reference>(), + (arg("self"), arg("index"))) + .def("__str__", &Quat::toString, arg("self")); + //.def(boost::python::self_ns::str(self)); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp index 388fd50a172eda835b51d9927120893ef9c79d53..3cfaf72e9ec1d44d7e3816714d8a8d30c5f98de4 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp @@ -233,33 +233,34 @@ void export_Statistics() { class_<Stats>("Stats", no_init) .def("getStatistics", &getStatisticsNumpy, getStatisticsOverloads( - args("data", "sorted"), + (arg("data"), arg("sorted")), "Determine the statistics for an array of data")) .staticmethod("getStatistics") - .def("getZscore", &getZscoreNumpy, args("data"), + .def("getZscore", &getZscoreNumpy, arg("data"), "Determine the Z score for an array of data") - .def("getZscore", &getZscoreNumpyDeprecated, args("data", "sorted"), + .def("getZscore", &getZscoreNumpyDeprecated, + (arg("data"), arg("sorted")), "Determine the Z score for an array of " "data (deprecated sorted argument)") .staticmethod("getZscore") .def("getModifiedZscore", &getModifiedZscoreNumpy, getModifiedZscoreOverloads( - args("data", "sorted"), + (arg("data"), arg("sorted")), "Determine the modified Z score for an array of data")) .staticmethod("getModifiedZscore") .def("getMomentsAboutOrigin", &getMomentsAboutOriginNumpy, getMomentsAboutOriginOverloads( - args("indep", "depend", "maxMoment"), + (arg("indep"), arg("depend"), arg("maxMoment")), "Calculate the first n-moments (inclusive) about the origin") [ReturnNumpyArray()]) .staticmethod("getMomentsAboutOrigin") .def("getMomentsAboutMean", &getMomentsAboutMeanNumpy, getMomentsAboutMeanOverloads( - args("indep", "depend", "maxMoment"), + (arg("indep"), arg("depend"), arg("maxMoment")), "Calculate the first n-moments (inclusive) about the mean") [ReturnNumpyArray()]) .staticmethod("getMomentsAboutMean"); diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp index 933d2862f9bb37333438a49df8a1e0785b6e0e0f..7311d4ac1c2e826d66a3f4692a7a2cfa91317106 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp @@ -12,6 +12,7 @@ using Mantid::Kernel::DateAndTime; using Mantid::Kernel::TimeSeriesProperty; using Mantid::Kernel::Property; using namespace boost::python; +using boost::python::arg; namespace { @@ -22,7 +23,8 @@ using Mantid::PythonInterface::Policies::VectorToNumpy; register_ptr_to_python<TimeSeriesProperty<TYPE> *>(); \ \ class_<TimeSeriesProperty<TYPE>, bases<Property>, boost::noncopyable>( \ - #Prefix "TimeSeriesProperty", init<const std::string &>()) \ + #Prefix "TimeSeriesProperty", \ + init<const std::string &>((arg("self"), arg("value")))) \ .add_property( \ "value", \ make_function( \ @@ -32,20 +34,26 @@ using Mantid::PythonInterface::Policies::VectorToNumpy; &Mantid::Kernel::TimeSeriesProperty<TYPE>::timesAsVector) \ .def("addValue", (void (TimeSeriesProperty<TYPE>::*)( \ const DateAndTime &, const TYPE)) & \ - TimeSeriesProperty<TYPE>::addValue) \ + TimeSeriesProperty<TYPE>::addValue, \ + (arg("self"), arg("time"), arg("value"))) \ .def("addValue", (void (TimeSeriesProperty<TYPE>::*)( \ const std::string &, const TYPE)) & \ - TimeSeriesProperty<TYPE>::addValue) \ - .def("valueAsString", &TimeSeriesProperty<TYPE>::value) \ - .def("size", &TimeSeriesProperty<TYPE>::size) \ - .def("firstTime", &TimeSeriesProperty<TYPE>::firstTime) \ - .def("firstValue", &TimeSeriesProperty<TYPE>::firstValue) \ - .def("lastTime", &TimeSeriesProperty<TYPE>::lastTime) \ - .def("lastValue", &TimeSeriesProperty<TYPE>::lastValue) \ - .def("nthValue", &TimeSeriesProperty<TYPE>::nthValue) \ - .def("nthTime", &TimeSeriesProperty<TYPE>::nthTime) \ - .def("getStatistics", &TimeSeriesProperty<TYPE>::getStatistics) \ - .def("timeAverageValue", &TimeSeriesProperty<TYPE>::timeAverageValue); + TimeSeriesProperty<TYPE>::addValue, \ + (arg("self"), arg("time"), arg("value"))) \ + .def("valueAsString", &TimeSeriesProperty<TYPE>::value, arg("self")) \ + .def("size", &TimeSeriesProperty<TYPE>::size, arg("self")) \ + .def("firstTime", &TimeSeriesProperty<TYPE>::firstTime, arg("self")) \ + .def("firstValue", &TimeSeriesProperty<TYPE>::firstValue, arg("self")) \ + .def("lastTime", &TimeSeriesProperty<TYPE>::lastTime, arg("self")) \ + .def("lastValue", &TimeSeriesProperty<TYPE>::lastValue, arg("self")) \ + .def("nthValue", &TimeSeriesProperty<TYPE>::nthValue, \ + (arg("self"), arg("index"))) \ + .def("nthTime", &TimeSeriesProperty<TYPE>::nthTime, \ + (arg("self"), arg("index"))) \ + .def("getStatistics", &TimeSeriesProperty<TYPE>::getStatistics, \ + arg("self")) \ + .def("timeAverageValue", &TimeSeriesProperty<TYPE>::timeAverageValue, \ + arg("self")); } void export_TimeSeriesProperty_Double() { diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/Unit.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/Unit.cpp index 41214aab50099f1331d4969307dd2757746c8391..ff85cee044ec2791322b67118a6bbf0a7a9aaf84 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/Unit.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/Unit.cpp @@ -33,15 +33,18 @@ void export_Unit() { register_ptr_to_python<boost::shared_ptr<Unit>>(); class_<Unit, boost::noncopyable>("Unit", no_init) - .def("name", &deprecatedName, + .def("name", &deprecatedName, arg("self"), "Return the full name of the unit (deprecated, use caption)") - .def("caption", &Unit::caption, "Return the full name of the unit") - .def("label", &deprecatedLabel, "Returns a plain-text label to be used " - "as the symbol for the unit (deprecated, " - "use symbol())") - .def("symbol", &Unit::label, "Returns a UnitLabel object that holds " - "information on the symbol to use for unit") + .def("caption", &Unit::caption, arg("self"), + "Return the full name of the unit") + .def("label", &deprecatedLabel, arg("self"), + "Returns a plain-text label to be used " + "as the symbol for the unit (deprecated, " + "use symbol())") + .def("symbol", &Unit::label, arg("self"), + "Returns a UnitLabel object that holds " + "information on the symbol to use for unit") .def( - "unitID", &Unit::unitID, + "unitID", &Unit::unitID, arg("self"), "Returns the string ID of the unit. This may/may not match its name"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/UnitConversion.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/UnitConversion.cpp index c39d60da1ef271a30b5e6b0a5496f5d65037fecc..f2f7ea98ad5f94a21f9d019ad326588dc0e50232 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/UnitConversion.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/UnitConversion.cpp @@ -1,6 +1,5 @@ #include "MantidKernel/UnitConversion.h" #include <boost/python/class.hpp> -#include <boost/python/args.hpp> using Mantid::Kernel::UnitConversion; using Mantid::Kernel::DeltaEMode; diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/UnitFactory.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/UnitFactory.cpp index 8bdf277857fdc6791f4777c96d10a4189e5e024a..361e6b1a50e6df26d75f66c7a7af9e43a7701585 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/UnitFactory.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/UnitFactory.cpp @@ -14,10 +14,10 @@ using namespace boost::python; void export_UnitFactory() { class_<UnitFactoryImpl, boost::noncopyable>("UnitFactoryImpl", no_init) - .def("create", &UnitFactoryImpl::create, + .def("create", &UnitFactoryImpl::create, (arg("self"), arg("className")), "Creates a named unit if it exists in the factory") - .def("getKeys", &UnitFactoryImpl::getKeys, + .def("getKeys", &UnitFactoryImpl::getKeys, arg("self"), return_value_policy<Policies::VectorToNumpy>(), "Returns a list of units available from the factory") diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/UnitLabel.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/UnitLabel.cpp index 757fafecd8652725a165b004321d18a48ab158df..c85ced6900046f9cf9250cbaf3bc4687583b4779 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/UnitLabel.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/UnitLabel.cpp @@ -52,18 +52,19 @@ void export_UnitLabel() { .def(init<UnitLabel::AsciiString>( (arg("ascii")), "Construct a label from a plain-text string")) - .def("ascii", &UnitLabel::ascii, + .def("ascii", &UnitLabel::ascii, arg("self"), return_value_policy<copy_const_reference>(), "Return the label as a plain-text string") - .def("utf8", &utf8ToUnicode, "Return the label as a unicode string") + .def("utf8", &utf8ToUnicode, arg("self"), + "Return the label as a unicode string") .def("latex", &UnitLabel::latex, - return_value_policy<copy_const_reference>(), + return_value_policy<copy_const_reference>(), arg("self"), "Return the label as a plain-text string with latex formatting") // special functions .def("__str__", &UnitLabel::ascii, - return_value_policy<copy_const_reference>()) - .def("__unicode__", &utf8ToUnicode); + return_value_policy<copy_const_reference>(), arg("self")) + .def("__unicode__", &utf8ToUnicode, arg("self")); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/Units.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/Units.cpp index fd07fd24004cb2c7c3d7a61445016b23a09b1834..54888c959e00c8a0dd44c6306045505598c7afc1 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/Units.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/Units.cpp @@ -25,13 +25,15 @@ void setLabelFromStdString(Label &self, const std::string &caption, // have additional functionality over the base class void export_Label() { class_<Label, bases<Unit>, boost::noncopyable>("Label", no_init) - .def("setLabel", &setLabelFromStdString, (arg("caption"), arg("label")), + .def("setLabel", &setLabelFromStdString, + (arg("self"), arg("caption"), arg("label")), "Set the caption (e.g.Temperature) & label (K) on the unit") .def("setLabel", (void (Label::*)(const std::string &, const UnitLabel &)) & Label::setLabel, - (arg("caption"), arg("label")), "Set the caption (e.g.Temperature) " - "& label (K) on the unit, See the " - "UnitLabel class"); + (arg("self"), arg("caption"), arg("label")), + "Set the caption (e.g.Temperature) " + "& label (K) on the unit, See the " + "UnitLabel class"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/V3D.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/V3D.cpp index bc4d9ce7ebd38b09a75b82c692408524dda1f32d..3b9f94dd6291bd7e797c990899758ee229354495 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/V3D.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/V3D.cpp @@ -28,30 +28,38 @@ void export_V3D() { class_<V3D>("V3D", init<>("Construct a V3D at the origin")) .def(init<double, double, double>( "Construct a V3D with X,Y,Z coordinates")) - .def("X", &V3D::X, return_value_policy<copy_const_reference>(), + .def("X", &V3D::X, arg("self"), + return_value_policy<copy_const_reference>(), "Returns the X coordinate") - .def("Y", &V3D::Y, return_value_policy<copy_const_reference>(), + .def("Y", &V3D::Y, arg("self"), + return_value_policy<copy_const_reference>(), "Returns the Y coordinate") - .def("Z", &V3D::Z, return_value_policy<copy_const_reference>(), + .def("Z", &V3D::Z, arg("self"), + return_value_policy<copy_const_reference>(), "Returns the Z coordinate") - .def("getX", &V3D::X, return_value_policy<copy_const_reference>(), + .def("getX", &V3D::X, arg("self"), + return_value_policy<copy_const_reference>(), "Returns the X coordinate") // Traditional name - .def("getY", &V3D::Y, return_value_policy<copy_const_reference>(), + .def("getY", &V3D::Y, arg("self"), + return_value_policy<copy_const_reference>(), "Returns the Y coordinate") // Traditional name - .def("getZ", &V3D::Z, return_value_policy<copy_const_reference>(), + .def("getZ", &V3D::Z, arg("self"), + return_value_policy<copy_const_reference>(), "Returns the Z coordinate") // Traditional name - .def("distance", &V3D::distance, + .def("distance", &V3D::distance, (arg("self"), arg("other")), "Returns the distance between this vector and another") - .def("angle", &V3D::angle, + .def("angle", &V3D::angle, (arg("self"), arg("other")), "Returns the angle between this vector and another") - .def("zenith", &V3D::zenith, + .def("zenith", &V3D::zenith, (arg("self"), arg("other")), "Returns the zenith between this vector and another") - .def("scalar_prod", &V3D::scalar_prod, + .def("scalar_prod", &V3D::scalar_prod, (arg("self"), arg("other")), "Computes the scalar product between this and another vector") - .def("cross_prod", &V3D::cross_prod, + .def("cross_prod", &V3D::cross_prod, (arg("self"), arg("other")), "Computes the cross product between this and another vector") - .def("norm", &V3D::norm, "Calculates the length of the vector") - .def("norm2", &V3D::norm2, "Calculates the squared length of the vector") + .def("norm", &V3D::norm, arg("self"), + "Calculates the length of the vector") + .def("norm2", &V3D::norm2, arg("self"), + "Calculates the squared length of the vector") .def(self + self) .def(self += self) .def(self - self) @@ -73,7 +81,8 @@ void export_V3D() { .def(self_ns::repr(self)) .def("__hash__", &hashV3D) .def("directionAngles", &V3D::directionAngles, + (arg("self"), arg("inDegrees")), "Calculate direction angles from direction cosines") - .def("directionAngles", &directionAnglesDefault, + .def("directionAngles", &directionAnglesDefault, arg("self"), "Calculate direction angles from direction cosines"); } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/VMD.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/VMD.cpp index 3bcdb46bba8de05180940dc0dee22b01b5542526..aafd51e6176cf9bcbc87faac5768a7d8c560dd90 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/VMD.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/VMD.cpp @@ -48,50 +48,56 @@ void setItem(VMD &self, const size_t index, const VMD_t value) { void export_VMD() { class_<VMD>("VMD", - init<>("Default constructor gives an object with 1 dimension")) + init<>(arg("self"), + "Default constructor gives an object with 1 dimension")) .def(init<VMD_t, VMD_t>( "Constructs a 2 dimensional vector at the point given", - args(("val0"), ("val1")))) + (arg("self"), arg("val0"), arg("val1")))) .def(init<VMD_t, VMD_t, VMD_t>( "Constructs a 3 dimensional vector at the point given", - args(("val0"), ("val1"), ("val2")))) + (arg("self"), arg("val0"), arg("val1"), arg("val2")))) .def(init<VMD_t, VMD_t, VMD_t, VMD_t>( "Constructs a 4 dimensional vector at the point given", - args(("val0"), ("val1"), ("val2"), ("val3")))) + (arg("self"), arg("val0"), arg("val1"), arg("val2"), arg("val3")))) .def(init<VMD_t, VMD_t, VMD_t, VMD_t, VMD_t>( "Constructs a 5 dimensional vector at the point given", - args(("val0"), ("val1"), ("val2"), ("val3"), ("val4")))) + (arg("self"), arg("val0"), arg("val1"), arg("val2"), arg("val3"), + arg("val4")))) .def(init<VMD_t, VMD_t, VMD_t, VMD_t, VMD_t, VMD_t>( "Constructs a 6 dimensional vector at the point given", - args(("val0"), ("val1"), ("val2"), ("val3"), ("val5")))) + (arg("self"), arg("val0"), arg("val1"), arg("val2"), arg("val3"), + arg("val4"), arg("val5")))) - .def("getNumDims", &VMD::getNumDims, + .def("getNumDims", &VMD::getNumDims, arg("self"), "Returns the number of dimensions the contained in the vector") - .def("scalar_prod", &VMD::scalar_prod, + .def("scalar_prod", &VMD::scalar_prod, (arg("self"), arg("other")), "Returns the scalar product of this vector with another. If the " "number of dimensions do not match a RuntimeError is raised") - .def("cross_prod", &VMD::cross_prod, + .def("cross_prod", &VMD::cross_prod, (arg("self"), arg("other")), "Returns the cross product of this vector with another. If the " "number of dimensions do not match a RuntimeError is raised") - .def("norm", &VMD::norm, "Returns the length of the vector") + .def("norm", &VMD::norm, arg("self"), "Returns the length of the vector") - .def("norm2", &VMD::norm2, "Returns the the squared length of the vector") + .def("norm2", &VMD::norm2, arg("self"), + "Returns the the squared length of the vector") - .def("normalize", &VMD::normalize, "Normalizes the length of the vector " - "to unity and returns the length " - "before it was normalized") + .def("normalize", &VMD::normalize, arg("self"), + "Normalizes the length of the vector " + "to unity and returns the length " + "before it was normalized") - .def("angle", &VMD::angle, "Returns the angle between the vectors in " - "radians (0 < theta < pi). If the dimensions " - "do not match a RuntimeError is raised") + .def("angle", &VMD::angle, (arg("self"), arg("other")), + "Returns the angle between the vectors in " + "radians (0 < theta < pi). If the dimensions " + "do not match a RuntimeError is raised") //----------------------------- special methods //-------------------------------- - .def("__getitem__", &getItem) - .def("__setitem__", &setItem) + .def("__getitem__", &getItem, (arg("self"), arg("value"))) + .def("__setitem__", &setItem, (arg("self"), arg("index"), arg("value"))) .def(self == self) .def(self != self) // must define != as Python's default is to compare // object address diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/VisibleWhenProperty.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/VisibleWhenProperty.cpp index 4ea24b4b27c5cc146e46a2fcf0a343ec968648e6..c1797a4e592052d345362a0ccc444f0821d495c3 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/VisibleWhenProperty.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/VisibleWhenProperty.cpp @@ -8,12 +8,12 @@ void export_VisibleWhenProperty() { class_<VisibleWhenProperty, bases<EnabledWhenProperty>, boost::noncopyable>( "VisibleWhenProperty", no_init) .def(init<std::string, ePropertyCriterion, std::string>( - (arg("otherPropName"), arg("when"), arg("value")), + (arg("self"), arg("otherPropName"), arg("when"), arg("value")), "Enabled otherPropName property when value criterion meets that " "given by the 'when' argument")) .def(init<std::string, ePropertyCriterion>( - (arg("otherPropName"), arg("when")), + (arg("self"), arg("otherPropName"), arg("when")), "Enabled otherPropName property when criterion does not require a " "value, i.e isDefault")); }