Mercurial > hg > vampy-host
diff vamp/frames.py @ 84:d91a2285fbb2
naming: local variables snake_case
author | Chris Cannam |
---|---|
date | Wed, 21 Jan 2015 13:04:01 +0000 |
parents | a11b57e9fb0b |
children | 3e5791890b65 |
line wrap: on
line diff
--- a/vamp/frames.py Wed Jan 21 12:46:33 2015 +0000 +++ b/vamp/frames.py Wed Jan 21 13:04:01 2015 +0000 @@ -2,10 +2,10 @@ import numpy -def frames_from_array(arr, stepSize, frameSize): - """Generate a list of frames of size frameSize, extracted from the input array arr at stepSize intervals""" +def frames_from_array(arr, step_size, frameSize): + """Generate a list of frames of size frameSize, extracted from the input array arr at step_size intervals""" # presumably such a function exists in many places, but I need practice - assert(stepSize > 0) + assert(step_size > 0) if arr.ndim == 1: # turn 1d into 2d array with 1 channel arr = numpy.reshape(arr, (1, arr.shape[0])) assert(arr.ndim == 2) @@ -18,5 +18,5 @@ pad = numpy.zeros((frame.shape[0], frameSize - w)) frame = numpy.concatenate((frame, pad), 1) yield frame - i = i + stepSize + i = i + step_size