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

Method configure

src/python/pyalgorithm.cpp:120–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118
119
120PyObject* PyAlgorithm::configure(PyAlgorithm* self, PyObject* args, PyObject* keywds) {
121
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 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 (const 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
154
155void deallocate_inputs(vector<void*> inputs, vector<Edt> inputTypes) {

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