MCPcopy Create free account
hub / github.com/MTG/essentia / paramType

Method paramType

src/python/pyalgorithm.cpp:413–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411
412
413PyObject* PyAlgorithm::paramType(PyAlgorithm* self, PyObject* obj) {
414 if (!PyString_Check(obj)) {
415 PyErr_SetString(PyExc_TypeError, "expected string as argument");
416 return NULL;
417 }
418
419 string name = PyString_AsString(obj);
420
421 // check if parameter exists
422 if (self->algo->defaultParameters().find(name) == self->algo->defaultParameters().end()) {
423 ostringstream msg;
424 msg << "'" << name << "' is not a parameter of " << self->algo->name();
425 PyErr_SetString(PyExc_ValueError, msg.str().c_str());
426 return NULL;
427 }
428
429 string tp = edtToString(paramTypeToEdt(self->algo->parameter(name).type()));
430
431 return String::toPythonCopy(&tp);
432}
433
434PyObject* PyAlgorithm::paramValue(PyAlgorithm* self, PyObject* obj) {
435 if (!PyString_Check(obj)) {

Callers 3

configureMethod · 0.45
configureMethod · 0.45
find_edtFunction · 0.45

Calls 5

edtToStringFunction · 0.85
paramTypeToEdtFunction · 0.85
strMethod · 0.80
endMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected