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

Method getOutputType

src/python/pystreamingalgorithm.cpp:258–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258PyObject* PyStreamingAlgorithm::getOutputType(PyStreamingAlgorithm* self, PyObject* obj) {
259 char* name = PyString_AsString(obj);
260 if (name == NULL) {
261 PyErr_SetString(PyExc_TypeError, "Algorithm.getOutputType requires 1 string argument");
262 return NULL;
263 }
264
265 string outputName = name;
266
267 if (!contains(self->algo->outputs(), outputName)) {
268 ostringstream msg;
269 msg << "'" << outputName << "' is not an output of " << self->algo->name() << ". Available outputs are " << self->algo->outputNames();
270 PyErr_SetString(PyExc_ValueError, msg.str().c_str());
271 return NULL;
272 }
273
274 string result = edtToString( typeInfoToEdt( self->algo->output(outputName).typeInfo() ) );
275 return toPython((void*)&result, STRING);
276}
277
278PyObject* PyStreamingAlgorithm::paramType(PyStreamingAlgorithm* self, PyObject* obj) {
279 if (!PyString_Check(obj)) {

Callers 1

generate_dot_algo_labelFunction · 0.80

Calls 7

containsFunction · 0.85
edtToStringFunction · 0.85
typeInfoToEdtFunction · 0.85
toPythonFunction · 0.85
strMethod · 0.80
nameMethod · 0.45
outputNamesMethod · 0.45

Tested by

no test coverage detected