Skip to content

Commit 6e118d9

Browse files
author
Joseph G. Shuttleworth
committed
Update ramp bound function and docstring
1 parent cfc1c60 commit 6e118d9

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

pcpostprocess/detect_ramp_bounds.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import numpy as np
22

33

4-
def detect_ramp_bounds(times, voltage_sections, ramp_no=0):
4+
def detect_ramp_bounds(times, voltage_sections, ramp_index=0):
55
"""
6-
Extract the the times at the start and end of the nth ramp in the protocol.
6+
Extract the timepoint indices at the start and end of the nth ramp in the protocol.
77
88
@param times: np.array containing the time at which each sample was taken
99
@param voltage_sections 2d np.array where each row describes a segment of the protocol: (tstart, tend, vstart, end)
10-
@param ramp_no: the index of the ramp to select. Defaults to 0 - the first ramp
10+
@param ramp_index: the index of the ramp to select. Defaults to 0 - the first ramp
1111
12-
@returns tstart, tend: the start and end times for the ramp_no+1^nth ramp
12+
@returns istart, iend: the start and end timepoint indices for the specified ramp
1313
"""
1414

1515
ramps = [(tstart, tend, vstart, vend) for tstart, tend, vstart, vend
1616
in voltage_sections if vstart != vend]
1717
try:
18-
ramp = ramps[ramp_no]
18+
ramp = ramps[ramp_index]
1919
except IndexError:
20-
print(f"Requested {ramp_no+1}th ramp (ramp_no={ramp_no}),"
20+
print(f"Requested {ramp_index+1}th ramp (ramp_index={ramp_index}),"
2121
" but there are only {len(ramps)} ramps")
2222

2323
tstart, tend = ramp[:2]

0 commit comments

Comments
 (0)