[Numpy-discussion] [ANN] NumPy 0.9.6 released
Travis Oliphant
oliphant at ee.byu.edu
Tue Mar 14 14:50:06 CST 2006
Fernando Perez wrote:
> Travis Oliphant wrote:
>
>> This post is to announce the release of NumPy 0.9.6 which fixes some
>> important bugs and has several speed improvments.
>
>
> Just curious about the svd/singular... pair:
>
> In [2]: numpy.linalg.singular_value_decomposition??
> Definition: numpy.linalg.singular_value_decomposition(A,
> full_matrices=0)
> Source:
> def singular_value_decomposition(A, full_matrices=0):
> return svd(A, full_matrices)
>
>
> In [3]: numpy.linalg.svd?
> Definition: numpy.linalg.svd(a, full_matrices=1)
>
>
> Do we really need both spellings to be different just on the default
> of the full_matrices flag? It seems to me like the kind of
> unnecessary special-casing that just forces people to remember little
> details without a clear benefit. If we want a long-spelling form, it
> would be cheaper to simply alias the name with a module-level
>
> singular_value_decomposition = svd
>
> so the same /object/ is referred to via both names.
>
> Perhaps I'm missing the blindingly obvious solid reason, but if this
> is just historical accident, I'd vote for unifying the two simply as
> spelling variants. I think the flipped default is more
> confusion-prone than beneficial.
Backward compatibility.
I don't like the singular_value_decomposition spelling but that was in
Numeric (with the default given). So, it is provided to aid in
code-porting.
But, I think most people who compute svd expect it to produce
full_matrices. Thus, the svd spelling.
We make somebody unhappy either way I think. If we change anything, I
would vote for changing singular_value_decomposition and adding
something to convert_code to write any old code using full arguments.
-Travis
More information about the Numpy-discussion
mailing list