Skip to content

Commit 8ccf93e

Browse files
committed
calcSTA(from => to) :) (unpack pair in func sig! :O julia <3)
1 parent ea87615 commit 8ccf93e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/VoltoMapSim/src/conntest.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
function calc_STA(VI_sig, presynaptic_spikes, p::ExperimentParams)
3-
Δt::Float64 = p.sim.general.Δt
2+
function calc_STA(VI_sig, presynaptic_spikes, p::ExpParams)
3+
Δt::Float64 = p.sim.general.Δt # explicit type annotation needed
44
win_size = round(Int, p.conntest.STA_window_length / Δt)
55
STA = zeros(eltype(VI_sig), win_size)
66
win_starts = round.(Int, presynaptic_spikes / Δt)
@@ -16,7 +16,7 @@ function calc_STA(VI_sig, presynaptic_spikes, p::ExperimentParams)
1616
return STA
1717
end
1818

19-
calc_STA(from::Int, to::Int, s #= simdata =#, p::ExpParams) =
19+
calc_STA((from, to)::Pair{Int, Int}, s::SimData, p::ExpParams) =
2020
calc_STA(s.signals[to].v, s.spike_times[from], p)
2121

2222

@@ -25,7 +25,7 @@ to_spiketimes!(ISIs) = cumsum!(ISIs, ISIs) # in place
2525

2626
shuffle_ISIs(spiketimes) = to_spiketimes!(shuffle!(to_ISIs(spiketimes)));
2727

28-
function test_connection(VI_sig, presynaptic_spikes, p::ExperimentParams, f = nothing)
28+
function test_connection(VI_sig, presynaptic_spikes, p::ExpParams, f = nothing)
2929
@unpack num_shuffles, STA_test_statistic = p.conntest
3030
isnothing(f) && (f = eval(Meta.parse(STA_test_statistic)))
3131
test_statistic(presynspikes) = f(calc_STA(VI_sig, presynspikes, p))

0 commit comments

Comments
 (0)