[Numpy-discussion] Style for pad implementation in 'pad' namespace or functions under np.lib

Travis Oliphant travis@continuum...
Mon Apr 2 12:56:29 CDT 2012

> I like the strings, maybe that is not the best, but yes I would like to defer that discussion.  Having the string representation does allow 'pad()' to make some checks on inputs to the built in functions.
> About whether to have "pad('mean', a, 5)" or "pad(a, 'mean', 5)" - I don't care.  It seems like we have two votes for the later form (Travis and Nathaniel) and unless others weigh in, I will make the change soonish.
> I think the suggestion is pad(a, 5, mode='mean'), which would be consistent with common numpy signatures. The mode keyword should probably have a default, something commonly used. I'd suggest 'mean', Nathaniel suggests 'zero', I think either would be fine.

It looks like most agree that pad(a, 5, mode='mean') is the preferred API.     In terms of the default, it really depends on the problem as to which one is most sensible.   

I notice that mode='edge' does not require additional keyword arguments and so perhaps this is the best default.    But, I think Tim should make the call on which default he prefers. 


> Chuck
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120402/32d6435b/attachment.html 

More information about the NumPy-Discussion mailing list