[SciPy-Dev] usage of inspect.getargspec ?

josef.pktd@gmai... josef.pktd@gmai...
Fri Jan 6 08:02:38 CST 2012

On Fri, Jan 6, 2012 at 8:46 AM, Denis Laxalde <denis.laxalde@mcgill.ca> wrote:
> josef.pktd@gmail.com a écrit :
>> Until now I have seen it mainly in convenience code were it makes it
>> easier for users but that I usually don't use, in this case it is part
>> of essential code.
> I actually thought twice before using getargspec here. But looking at
> scipy sources revealed that it was already part of essential code (stats
> and optimize at least), so I just moved forward.

a quick check:
curve_fit is a convenience wrapper around optimize.leastsq
stats.morestats has it twice in commented out code
2 usages in distributions:
    once to check the signature of the internal _stats of subclasses
which has a controlled signature
    once to distinguish discrete distributions given by support and
weights from the standard parameterized distributions. I always found
this case confusing and would prefer if the support/weights
distribution were separated from the base class for discrete

    distributions also use vectorize and it needed some difficult bug
tracking to get the methods to work because vectorize didn't recognize
the number of parameters as intended

one case in _nonlin_wrapper which I know nothing about since I never used it.

fmin_ncg is a basic library function that handles a pretty wide range
of user defined "callables", and I prefer robustness to having a one
argument shorter signature.

And I agree with Nathaniel, and I also don't see how merging the two
arguments unambiguously can be done in a way that doesn't get more
complicated than the original version


> --
> Denis
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev

More information about the SciPy-Dev mailing list