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

Method getInputType

src/python/pystreamingalgorithm.cpp:238–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238PyObject* PyStreamingAlgorithm::getInputType(PyStreamingAlgorithm* self, PyObject* obj) {
239 char* name = PyString_AsString(obj);
240 if (name == NULL) {
241 PyErr_SetString(PyExc_TypeError, "Algorithm.getInputType requires 1 string argument");
242 return NULL;
243 }
244
245 string inputName = name;
246
247 if (!contains(self->algo->inputs(), inputName)) {
248 ostringstream msg;
249 msg << "'" << inputName << "' is not an input of " << self->algo->name() << ". Available inputs are " << self->algo->inputNames();
250 PyErr_SetString(PyExc_ValueError, msg.str().c_str());
251 return NULL;
252 }
253
254 string result = edtToString( typeInfoToEdt( self->algo->input(inputName).typeInfo() ) );
255 return toPython((void*)&result, STRING);
256}
257
258PyObject* PyStreamingAlgorithm::getOutputType(PyStreamingAlgorithm* self, PyObject* obj) {
259 char* name = PyString_AsString(obj);

Callers 2

__rshift__Method · 0.80
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
inputNamesMethod · 0.45

Tested by

no test coverage detected