[Numpy-discussion] any interest in including asecond-ordergradient?
Stéfan van der Walt
Wed Oct 29 12:29:52 CDT 2008
2008/10/29 Andrew Hawryluk <HAWRYLA@novachem.com>:
> Any chance of using the proposed API with the existing name? What is
> deemed sufficient justification for modifying the API of an existing
> NumPy function? It causes trouble for existing users, but the number of
> future users exceeds the number of existing users, so maybe it is worth
> the trouble. If not, you could just call it 'grad' and deprecate the old
> one as you suggest.
Again, I would opt to change the API now and save us and our users the
pain of doing it later (looking at the API for a function like
gradient, it strikes me that the API freeze was premature and done
without a proper review -- this function would never have passed!).
My opinion is not a popular one, though, so I suspect we'll have to
create a new function. If we do that, it is important that we rewrite
the old function in terms of the new one, i.e.
def gradient(x, *varargs): return new_gradient(x, varargs)
so that we don't have to maintain two functions.
More information about the Numpy-discussion