[SciPy-dev] subversion commit policy for rename files question
Fri Nov 21 23:10:03 CST 2008
On Fri, Nov 21, 2008 at 11:30 PM, Robert Kern <firstname.lastname@example.org> wrote:
> On Fri, Nov 21, 2008 at 21:29, <email@example.com> wrote:
>> I want to do the renaming and importing in __all__ discussed here:
>> For this I had to resolve some circular imports and add some missing
>> functions to __all__.
>> Is there a policy whether renames should be committed separately or
>> can it be together with changes in the file,
>> or it doesn't matter?
> I take my "doesn't matter" back. Yes, please do file renames and
> internal modifications separately.
> Robert Kern
Thanks, I will do it in several steps.
All tests pass (after making sure that no old stuff is lying around),
but not every function is tested.
Also np.lookfor picks it up
given our previous discussion, and the wikipedia definition of
percentileofscore, I don't see any reason not to do a very simple
Initially, I thought the proposed implementation can be vectorized,
but I don't see how. Without vectorization, this version looks much
simpler and, I guess, should be about as fast:
import numpy as np
def percentileofscore(a, score, kind = 'mean' ):
n = len(a)
if kind == 'strict':
return sum(a<score) / float(n) * 100
elif kind == 'weak':
return sum(a<=score) / float(n) * 100
elif kind == 'mean':
return (sum(a<score) + sum(a<=score)) * 50 / float(n)
If you think this is ok, I put it in svn, I'm not sure whether to call
the type, "kind", doctest pass the same as previous version
More information about the Scipy-dev