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

Nathaniel Smith njs at pobox.com
Thu Dec 24 18:06:14 EST 2009


On Thu, Dec 24, 2009 at 9:57 AM,  <josef.pktd at gmail.com> wrote:
> On Thu, Dec 24, 2009 at 10:49 AM, Ondrej Certik <ondrej at certik.cz> wrote:
>> On Thu, Dec 24, 2009 at 4:40 PM, Gael Varoquaux
>> <gael.varoquaux at normalesup.org> wrote:
>>> On Thu, Dec 24, 2009 at 04:00:21PM +0100, Robert Cimrman wrote:
>>>> 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?
>>>
>>> Bad.
>>
>> Good.
>
> Bad in general. (If you mix arrays and matrices it might be helpful
> internally as a reminder.)
>
> And I like informative names, where I don't need a book or paper to
> follow the notation, and go back to the table of shortcut definitions
> or docstrings every five minutes. My short term memory is too short to
> remember what A,B,C, P, X, Y, ... and phi, psi, omega,... mean in
> different contexts. But this depends on whether you program for
> insiders or the general public.

I agree with all the general principles here, but still stand by the
current function names in this case. PEP8 and all that are a tool to
help us write clear and usable code, and should be ignored when their
prescriptions don't help us do that. Obviously when this happens is a
matter of taste... But here, we're talking about object that
represents the factorization
  LDL' = PAP'
or
  LL' = PAP'
and we need to refer to expressions like DL'.

These are standard names in the literature, used consistently through
the docs, and what else can you call the parts of a Cholesky factor
that would be more informative than confusing? Esp. since the solve_*
interfaces are pretty much expert only; people who just want to solve
a positive-definite system won't see them.

-- Nathaniel



More information about the SciPy-Dev mailing list