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

Method configure

src/python/pystreamingalgorithm.cpp:121–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121PyObject* PyStreamingAlgorithm::configure (PyStreamingAlgorithm* self, PyObject* args, PyObject* keywds) {
122 E_DEBUG(EPyBindings, PY_ALGONAME << "::Configure()");
123
124 // create the list of named parameters that this algorithm can accept
125 ParameterMap pm = self->algo->defaultParameters();
126
127 // parse parameters
128 try {
129 parseParameters(&pm, args, keywds);
130 }
131 catch (const std::exception& e) {
132 ostringstream msg;
133 msg << "Error while parsing parameters: " << e.what();
134 PyErr_SetString(PyExc_RuntimeError, msg.str().c_str());
135 return NULL;
136 }
137
138 // actually configure the underlying C++ algorithm
139 try {
140 self->algo->configure(pm);
141 }
142 catch (std::exception& e) {
143 ostringstream msg;
144 msg << "Error while configuring " << self->algo->name() << ": " << e.what();
145 PyErr_SetString(PyExc_RuntimeError, msg.str().c_str());
146 return NULL;
147 }
148
149 E_DEBUG(EPyBindings, PY_ALGONAME << "::Configure() done!");
150
151 Py_RETURN_NONE;
152}
153
154PyObject* PyStreamingAlgorithm::hasSink(PyStreamingAlgorithm* self, PyObject* obj) {
155 char* name = PyString_AsString(obj);

Callers

nothing calls this directly

Calls 4

parseParametersFunction · 0.85
strMethod · 0.80
whatMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected