Skip to content

Commit 71d2426

Browse files
committed
clarify tau units in spikes_to_biexp
1 parent 42b1f04 commit 71d2426

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "wslfp"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "Weighted Sum Local Field Potentials - Implementation of the proxy method for point neurons from Mazzoni, Lindén et al., 2015"
55
authors = [
66
"Kyle Johnsen <kyle@kjohnsen.org>",

wslfp/spk2curr.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def spikes_to_biexp_currents(
2121
t_spk_ms: np.ndarray,
2222
i_spk: np.ndarray,
2323
J: Union[np.ndarray, sparse.sparray],
24-
tau1: float,
25-
tau2: float,
24+
tau1_ms: float,
25+
tau2_ms: float,
2626
syn_delay_ms: float = 1,
2727
normalize: bool = False,
2828
threshold: float = 0.001,
@@ -67,15 +67,15 @@ def spikes_to_biexp_currents(
6767
assert t_spk_conv.shape == (T, n_spk)
6868
assert np.all(np.diff(t_spk_ms) >= 0), "assuming t_spk_ms is sorted"
6969

70-
assert tau1 > tau2, "tau1 must be greater than tau2"
70+
assert tau1_ms > tau2_ms, "tau1 must be greater than tau2"
7171

7272
# Define a function for the difference between the biexp_kernel and the threshold
7373
def biexp(t):
74-
return biexp_kernel(t, tau1, tau2, normalize=True) - threshold
74+
return biexp_kernel(t, tau1_ms, tau2_ms, normalize=True) - threshold
7575

7676
# Use fsolve to find the time when the biexp_kernel drops to the threshold
77-
t_end = fsolve(biexp, 6 * tau1)[0]
78-
assert t_end > tau1
77+
t_end = fsolve(biexp, 6 * tau1_ms)[0]
78+
assert t_end > tau1_ms
7979

8080
I_syn = np.zeros((T, n_targets))
8181

@@ -89,7 +89,9 @@ def biexp(t):
8989
continue
9090
window_sizes[t] = spk_right - spk_left
9191

92-
I_syn_t = biexp_kernel(t_spk_conv[t, spk_left:spk_right], tau1, tau2, normalize)
92+
I_syn_t = biexp_kernel(
93+
t_spk_conv[t, spk_left:spk_right], tau1_ms, tau2_ms, normalize
94+
)
9395

9496
J_t = J[i_spk[spk_left:spk_right], :]
9597
# numpy doesn't handle multiplication with sparse matrices

0 commit comments

Comments
 (0)