Ryan May wrote:
> John Hunter wrote:
>   
>> On Tue, Nov 11, 2008 at 1:38 PM, Ryan May <[EMAIL PROTECTED]> wrote:
>>
>>     
>>> 1) Have psd(x) call csd(x,x)
>>> 2) Have csd() check if y is x, and if so, avoid doing the extra work.
>>>
>>> Would this be an acceptable solution to reduce code duplication?
>>>       
>> Sure, that should work fine.
>>     
>
> Ok, I noticed that specgram() duplicated much of the same code, so I
> factored it all out and made a _spectral_helper() function, which pretty
> much implements a cross-spectrogram.  csd() and specgram() use this, and
> then psd still calls csd().  Now all of the spectral analysis stuff is
> using the same computational code base.
>
>   
>>> On a separate note, once I get done with these tweaks, are there any
>>> objections to submitting something based on this to scipy?
>>>       
>> No objections here -- if it were put into numpy though, we could
>> depend on it and avoid the duplication.  I would campaign for numpy
>> first, eg np.fft.psd, etc.
>>     
>
> I agree it'd be better for us if it went to numpy, but I've gotten the
> sense that they're not really receptive to adding things like this now.
> I'll give it a try, but I sense that scipy.signal would end up being a
> more likely home.  That wouldn't help us with duplication, but would
> help the community at large.  It's always bugged me that I can't just
> grab a psd() function from my general computing packages. (In my
> opinion, anything in mlab that doesn't involve plotting should really
> exist in a more general package.)
There's an interesting case to be made here for modules shared between
packages at the version-control-system and bug tracking level (e.g. in a
DVCS type system) but installed in separate namespaces and shipped
independently when it was time for source and binary distributions of
the package to be made. There'd be duplication at the install and
distribution level, but at least not at the source level. I'd guess the
linux packagers would also find a way to reduce duplication at those
other levels, too, for their systems.

It seems to me that this would reduce a lot of the developer angst about
having multiple sources for the same things, while still making things
easy on the users.

However, I don't know any VCS that would facilitate such a thing...

-Andrew

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to