Skip to content

Commit ee18224

Browse files
committed
numpy docstrings.
1 parent 412f642 commit ee18224

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

phys2bids/cli/run.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ def _get_parser():
153153
type=float,
154154
help="The Confidence Interval (CI) to use in the estimation of the trigger clusters. "
155155
"The cluster algorithm considers triggers with duration (in samples) within this "
156-
"CI as part of the same group. If CI is an integer, it will consider that amount "
157-
"of triggers. If CI is a float and < 1, it will consider that percentage of the "
158-
"trigger duration. CI cannot be a float > 1. Default is 1. Change to .25 if "
159-
"there is a CMRR DWI sequence or if you are recording sub-triggers.",
156+
"CI as part of the same group, thus the same. If CI is an integer, it will consider "
157+
"that amount of triggers. If CI is a float and < 1, it will consider that "
158+
"percentage of the trigger duration. CI cannot be a float > 1. Default is 1. "
159+
"Change to .25 if there is a CMRR DWI sequence or when recording sub-triggers.",
160160
default=1,
161161
)
162162
optional.add_argument(

phys2bids/slice4phys.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,35 @@
1111
def estimate_ntp_and_tr(phys_in, thr=None, ci=1):
1212
"""
1313
Find groups of trigger in a spiky signal like the trigger channel signal.
14+
15+
Parameters
16+
----------
17+
phys_in : BlueprintInput object
18+
A BlueprintInput object containing a physiological acquisition
19+
thr : None, optional
20+
The threshold for automatic spike detection. Default is to use the average of
21+
the signal.
22+
ci : int or float, optional
23+
Confidence Interval (CI) to use in the estimation of the trigger clusters. The
24+
cluster algorithm considers triggers with duration (in samples) within this CI
25+
as part of the same group, thus the same. If CI is an integer, it will consider
26+
that amount of triggers. If CI is a float and < 1, it will consider that
27+
percentage of the trigger duration. CI cannot be a float > 1. Default is 1.
28+
Change to .25 if there is a CMRR DWI sequence or when recording sub-triggers.
29+
30+
Returns
31+
-------
32+
ntp
33+
The list of number of timepoints found for each take.
34+
tr
35+
The list of corresponding TR, computed as average samples per group / frequency.
36+
37+
Raises
38+
------
39+
Exception
40+
If it doesn't find at least a group.
41+
ValueError
42+
If CI is a float above 1 or if it is not an int or a float.
1443
"""
1544
LGR.info('Running automatic clustering of triggers to find timepoints and tr of each "take"')
1645
trigger = phys_in.timeseries[phys_in.trigger_idx]
@@ -27,7 +56,7 @@ def estimate_ntp_and_tr(phys_in, thr=None, ci=1):
2756
elif isinstance(ci, float) and ci < 1:
2857
upper_ci_isi = unique_isi * (1 + ci)
2958
elif isinstance(ci, float) and ci > 1:
30-
raise ValueError("Confidence intervals above 1 are not supported.")
59+
raise ValueError("Confidence intervals percentages above 1 are not supported.")
3160
else:
3261
raise ValueError("Confidence intervals must be either integers or floats.")
3362

0 commit comments

Comments
 (0)