[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [IMP-dev] Harmonic cleanup



Daniel Russel wrote:
I can do this very easily without any changes to the C++ code. But maybe
for consistency between C++ and Python it makes more sense to replace
operator() with evaluate(feat) and evaluate_deriv(feat, &deriv) ?
I like having C++ and python the same and (*f_)(value) looks kind of silly anyway.

Agreed - so I put it in as r473.

If it can be made to work easily in python, I would propose have the deriv version return a pair or tuple in C++ too.

Yes, I had that in mind when I proposed it - now that the methods have different names, we can have different return types. But I don't know if SWIG has any typemaps for pair or tuple - if not it might be a bit awkward to make it work nicely in Python. It works just fine as is.

It would be really nice to be able to run tests on unary
functions.
Well, we already can, of course - just not on the derivatives.
Sure. But consistency between function and its derivative seems like the main nontrivial thing to check.

Agreed.

	Ben
--
                      http://salilab.org/~ben/
"It is a capital mistake to theorize before one has data."
	- Sir Arthur Conan Doyle