[SciPy-dev] [announce] scikits.sparse v0.1, wrapper for CHOLMOD (and hopefully more)

Robert Cimrman cimrman3@ntc.zcu...
Thu Dec 24 09:00:21 CST 2009


On Wed, 23 Dec 2009, James Bergstra wrote:

> On Mon, Dec 21, 2009 at 11:42 AM, Robert Cimrman <cimrman3@ntc.zcu.cz> wrote:
>> In this case, the issue could be side-stepped by replacing the specialized
>> functions, e.g. all Factor.solve_*() by a single function, e.g. Factor.solve(
>> ..., mode='A') with a 'mode' argument. What do you think? Typing
>> Factor.solve_P(b) or Factor.solve(b, 'P')
>> seems of the same complexity/readability to me.
>
> FWIW, Factor.solve_P can be tab-completed, whereas Factor.solve(b, 'P') cannot.
> Also, the second form suggests [to me] that any letter or string could
> go in place of 'P'.  I presume from the two options that actually
> there are just a few constants that make sense instead of 'P', but
> that wouldn't be clear from the second form alone.
>
> Maybe the sense of a cluttered interface can be addressed by better
> formatting of the docs (??)

The tab completion is a good point, I did not think about that. In the 
one function case the possible modes would be listed in its docstring 
only. But one has to read docstrings anyway (well, sometimes :)) and all 
the related functionality would be in one place which is IMHO good. Just 
my 2 cents.

I would like to hear some feedback to my original naming style question, 
as I face same issues in my projects too. The question is about using 
function names that mix underscores with capital letters, e.g. 
solve_P(). This style is marked "bad" in the Python docs, but in linear 
algebra, matrices are commonly denoted by capital letters. So what do you 
think?

cheers,

r.
PS: Merry Christmas!


More information about the SciPy-Dev mailing list