Skip to content

Commit 351dd52

Browse files
committed
revert struct SimData. back to plain NT
1 parent 6aa5d41 commit 351dd52

File tree

8 files changed

+78
-62
lines changed

8 files changed

+78
-62
lines changed

nb/2022-09-11__Fit_function_to_STA.ipynb

Lines changed: 67 additions & 29 deletions
Large diffs are not rendered by default.

nb/2022-09-11__Fit_function_to_STA.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ p = get_params(
4646

4747
s = cached(sim, [p.sim]);
4848

49+
snt = s.data;
50+
51+
52+
53+
54+
4955
s = augment(s, p);
5056

5157
# ## ...

pkg/VoltoMapSim/src/VoltoMapSim.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ const datamodel_version = "2 (net)"
1313
include("units.jl")
1414
# [see file for exports]
1515

16-
include("types.jl")
17-
export SimData
16+
const SimData = NamedTuple
1817

1918
include("misc.jl")
2019
export LogNormal_with_mean, ptp, area, bin, jn

pkg/VoltoMapSim/src/sim/net/init.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function init_sim(p::NetworkSimParams)
138138
)
139139
end
140140

141-
return state = SimData(;
141+
return state = (;
142142
#
143143
# Fixed at init:
144144
num_timesteps,

pkg/VoltoMapSim/src/sim/net/step.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
function step_sim!(state::SimData, params::NetworkSimParams, i)
2+
function step_sim!(state, params::NetworkSimParams, i)
33

44
@unpack output_synapses, postsyn_neuron, neuron_type,
55
syn_strengths, spike_tx_delay = state

pkg/VoltoMapSim/src/sim/post.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function augment(s::SimData, p::ExpParams)
3131
non_inputs = [[n for n in all if n inputs[m] && n != m] for m in all]
3232
num_inputs = [(exc = length(exc_inputs[m]), inh = length(inh_inputs[m])) for m in all]
3333

34-
return SimData(;
34+
return (;
3535
s.data...,
3636
num_spikes_per_neuron,
3737
spike_rates,

pkg/VoltoMapSim/src/sim/sim.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include("Nto1/step.jl")
88
include("post.jl")
99

1010
function sim(params::SimParams)
11-
state::SimData = init_sim(params)
11+
state = init_sim(params)
1212
@showprogress (every = 400ms) "Running simulation: " (
1313
for i in 1:state.num_timesteps
1414
step_sim!(state, params, i)

pkg/VoltoMapSim/src/types.jl

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)