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

Method paramType

src/python/pystreamingalgorithm.cpp:278–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278PyObject* PyStreamingAlgorithm::paramType(PyStreamingAlgorithm* self, PyObject* obj) {
279 if (!PyString_Check(obj)) {
280 PyErr_SetString(PyExc_TypeError, "expected string as argument");
281 return NULL;
282 }
283
284 string name = PyString_AsString(obj);
285
286 // check if parameter exists
287 if (self->algo->defaultParameters().find(name) == self->algo->defaultParameters().end()) {
288 ostringstream msg;
289 msg << "'" << name << "' is not a parameter of " << self->algo->name();
290 PyErr_SetString(PyExc_ValueError, msg.str().c_str());
291 return NULL;
292 }
293
294 string tp = edtToString(paramTypeToEdt(self->algo->parameter(name).type()));
295
296 return toPython((void*)&tp, STRING);
297}
298
299
300PyObject* PyStreamingAlgorithm::paramValue(PyStreamingAlgorithm* self, PyObject* obj) {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected