Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
b549013
added orient plot
adampdp Nov 10, 2025
493b674
added trajectory plots
adampdp Nov 12, 2025
21d7b66
added worm rotation
adampdp Nov 12, 2025
cbde706
reorganized python plot
adampdp Nov 12, 2025
9485c61
plots multiple runs
adampdp Nov 12, 2025
5e960d0
fixed globals bug
adampdp Nov 13, 2025
d9b01f4
changed evol to rotation
adampdp Nov 13, 2025
b84f4bd
added some plotting functions
adampdp Nov 13, 2025
b3d32ab
plotting updates
adampdp Nov 14, 2025
3aa6ea5
changed 18 tests to fixed initial
adampdp Nov 14, 2025
c59d1dd
updates for CO18
adampdp Nov 15, 2025
71dc6be
tweaks for ruff
adampdp Nov 15, 2025
fc76f71
added scipy
adampdp Nov 15, 2025
fabe8f9
added bodycon to RS18
adampdp Nov 15, 2025
5730262
updated SR18
adampdp Nov 15, 2025
c22cbc2
SR18 simplification
adampdp Nov 17, 2025
178c885
updates to SR
adampdp Nov 17, 2025
c9aa8a4
updated SR18
adampdp Nov 18, 2025
78a3d60
updates SR
adampdp Nov 18, 2025
ba9ee7a
updates to SR18 and W18
adampdp Nov 20, 2025
7ff1906
added W2D18gen test
adampdp Nov 20, 2025
fb1c2b7
added W2DSR18 tests and fixes
adampdp Nov 20, 2025
93b9439
added NS input and output
adampdp Nov 21, 2025
8ce1993
utils.h
adampdp Nov 28, 2025
7e9725e
various updates for osc models
adampdp Nov 28, 2025
f2bd44c
updates for osc models
adampdp Nov 29, 2025
9909299
fixed warning
adampdp Nov 29, 2025
f32186c
updates for musc nml
adampdp Nov 30, 2025
fd7167e
updates for musc
adampdp Nov 30, 2025
49c5e47
updates for musc nml
adampdp Dec 3, 2025
b6315d2
added musc_W2D
adampdp Dec 4, 2025
9eef51b
added osc_sim tests
adampdp Dec 5, 2025
9a03710
various fixes
adampdp Dec 6, 2025
1de7365
tweak
adampdp Dec 6, 2025
8f36028
added utils
adampdp Dec 6, 2025
c7a2934
added syn xml
adampdp Dec 6, 2025
65cf679
added osc 21 tests
adampdp Dec 7, 2025
05c08be
added model name
adampdp Dec 7, 2025
28da529
model name fixes
adampdp Dec 7, 2025
4a11642
added W2Dosc21all tests
adampdp Dec 8, 2025
38bce1a
fixed issue
adampdp Dec 8, 2025
41a80ba
added W2DSR musc
adampdp Dec 9, 2025
fa87684
added several tests
adampdp Dec 12, 2025
040b33c
updates to json
adampdp Dec 12, 2025
3213b10
fixed timestep issue
adampdp Dec 13, 2025
5132247
adjusted model name
adampdp Dec 13, 2025
144b76a
updates to main_sim
adampdp Dec 14, 2025
ed51aa1
fixed issues
adampdp Dec 14, 2025
96c7a0b
fixed issue
adampdp Dec 14, 2025
c0c49c4
tweak
adampdp Dec 15, 2025
9aa8b83
floats to double
adampdp Dec 15, 2025
709a718
updates
adampdp Dec 15, 2025
6cdf619
tweaked test
adampdp Dec 15, 2025
4f7449c
float to double
adampdp Dec 15, 2025
cd12cb3
fixed PG issue
adampdp Dec 16, 2025
4e40c1e
fixed wcon time
adampdp Dec 16, 2025
9a68fd3
tweak
adampdp Dec 16, 2025
0418bf6
updates
adampdp Dec 17, 2025
e9d2ae3
added testW2DSR21
adampdp Dec 17, 2025
d261754
update
adampdp Dec 17, 2025
da1be44
added vector classes
adampdp Dec 18, 2025
111dc86
changed vector class
adampdp Dec 18, 2025
007855f
updates to vector
adampdp Dec 18, 2025
48f30f0
added rewritten classes
adampdp Dec 18, 2025
6054932
added TVector support
adampdp Dec 19, 2025
704be74
updates
adampdp Dec 19, 2025
4adb427
TSearch revamp
adampdp Dec 20, 2025
32501be
updated TSearch
adampdp Dec 21, 2025
c7c98fb
updates
adampdp Dec 21, 2025
fd60130
try different test
adampdp Dec 21, 2025
9b6786c
update evolution
adampdp Dec 22, 2025
d2864b6
evo updates
adampdp Dec 22, 2025
964293f
updates to evo
adampdp Dec 22, 2025
c0d6f76
fixed issue
adampdp Dec 22, 2025
1a88817
reverted random
adampdp Dec 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci-make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ jobs:
pip install pyNeuroML
pip install numpy matplotlib
pip install ruff

pip install scipy

- name: Test directly running main program
run: |
./main -p 6 # Note: small population of 6 for quick runtime
Expand Down
3 changes: 2 additions & 1 deletion .test.2018.mep
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ system: Testing activity of some neurons
experiments:
Test:
expected:
spike times: [0.17, 8.57, 18.73, 29.09, 39.49, 49.85]
spike times: [0.09, 7.21, 17.45, 28.25, 39.05, 49.85]

12 changes: 12 additions & 0 deletions .test.2018gen.mep
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
system: Testing activity of some neurons

experiments:
Test:
expected:
spike times: [0.25, 4.93, 18.25]
Test2:
expected:
spike times: [0.25, 4.93, 18.25]
Test3:
expected:
spike times: [0.25, 4.93, 18.25]
18 changes: 18 additions & 0 deletions .test.W2D18gen.omt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Framework for running automated tests on Open Source Brain
# See https://github.com/OpenSourceBrain/osb-model-validation for more details

target: testW2D18gen.py
engine: Brian2 # This installs Brian2, but all we really need is a Python environment to run the script in
mep: .test.2018gen.mep
experiments:
Test:
observables:
spike times:
file:
path: testruns/exW2D18gen/act.dat
columns: [0, 1]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 1
tolerance: 0
8 changes: 7 additions & 1 deletion .test.W2DCE.mep
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ system: Testing activity of some neurons
experiments:
Test:
expected:
spike times: [0.405, 8.555]
spike times: [0.405, 8.555]
Test2:
expected:
spike times: [0.405, 8.005, 12.155, 17.355]
Test3:
expected:
spike times: [0.455, 8.055, 12.205, 17.355]
24 changes: 23 additions & 1 deletion .test.W2DSR.omt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,29 @@ experiments:
observables:
spike times:
file:
path: experiments/exW2DSR/act.dat
path: testruns/exW2DSR/act.dat
columns: [0,3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 2
tolerance: 0
Test2:
observables:
spike times:
file:
path: testruns/exW2DSR_nml/act.dat
columns: [0,3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 2
tolerance: 0
Test3:
observables:
spike times:
file:
path: testruns/exW2DSR_nml_musc/act.dat
columns: [0,3]
scaling: [1, 1]
spike detection:
Expand Down
19 changes: 19 additions & 0 deletions .test.W2DSR18.omt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Framework for running automated tests on Open Source Brain
# See https://github.com/OpenSourceBrain/osb-model-validation for more details

target: testW2DSR18.py
engine: Brian2 # This installs Brian2, but all we really need is a Python environment to run the script in
mep: .test.2018gen.mep
experiments:
Test:
observables:
spike times:
file:
path: testruns/exW2DSR18/act.dat
columns: [0, 1]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 1
tolerance: 0

12 changes: 12 additions & 0 deletions .test.W2DSR21.mep
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
system: Testing activity of some neurons

experiments:
Test:
expected:
spike times: [50.155, 52.455, 54.705, 57.005, 59.255, 61.555, 63.805, 66.105, 68.355, 70.605, 72.905, 75.155, 77.455, 79.705, 82.005, 84.255, 86.555, 88.805, 91.105, 93.355, 95.605, 97.905, 100.155, 102.455, 104.705, 107.005]
Test2:
expected:
spike times: [50.155, 52.455, 54.705, 57.005, 59.255, 61.555, 63.805, 66.105, 68.355, 70.605, 72.905, 75.155, 77.455, 79.705, 82.005, 84.255, 86.555, 88.805, 91.105, 93.355, 95.605, 97.905, 100.155, 102.455, 104.705, 107.005]
Test3:
expected:
spike times: [50.155, 52.455, 54.705, 57.005, 59.255, 61.555, 63.805, 66.105, 68.355, 70.605, 72.905, 75.155, 77.455, 79.705, 82.005, 84.255, 86.555, 88.805, 91.105, 93.355, 95.605, 97.905, 100.155, 102.455, 104.705, 107.005]
40 changes: 40 additions & 0 deletions .test.W2DSR21.omt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Framework for running automated tests on Open Source Brain
# See https://github.com/OpenSourceBrain/osb-model-validation for more details

target: testW2DSR21.py
engine: Brian2 # This installs Brian2, but all we really need is a Python environment to run the script in
mep: .test.W2DSR21.mep
experiments:
Test:
observables:
spike times:
file:
path: testruns/exW2DSR21_nml/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0.031
Test2:
observables:
spike times:
file:
path: testruns/exW2DSR21/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0
Test3:
observables:
spike times:
file:
path: testruns/exW2DSR21_nml_musc/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0.031
12 changes: 12 additions & 0 deletions .test.osc_sim.mep
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
system: Testing activity of some neurons

experiments:
Test2:
expected:
spike times: [11.005, 13.655, 16.305, 18.955]
Test3:
expected:
spike times: [11.005, 13.655, 16.305, 18.955]
Test4:
expected:
spike times: [11.005, 13.655, 16.305, 18.955]
41 changes: 41 additions & 0 deletions .test.osc_sim.omt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Framework for running automated tests on Open Source Brain
# See https://github.com/OpenSourceBrain/osb-model-validation for more details

target: run_osc_sim.py
engine: Brian2 # This installs Brian2, but all we really need is a Python environment to run the script in
mep: .test.osc_sim.mep
experiments:
Test2:
observables:
spike times:
file:
path: experiments/osc_sim_nml/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0.0

Test3:
observables:
spike times:
file:
path: experiments/osc_sim_nml_musc/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0.0
Test4:
observables:
spike times:
file:
path: experiments/osc_sim/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0.0
12 changes: 12 additions & 0 deletions .test.osc_sim_21.mep
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
system: Testing activity of some neurons

experiments:
Test2:
expected:
spike times: [10.655, 12.705, 14.755, 16.805, 18.855]
Test3:
expected:
spike times: [10.655, 12.705, 14.755, 16.805, 18.855]
Test4:
expected:
spike times: [10.655, 12.705, 14.755, 16.805, 18.855]
41 changes: 41 additions & 0 deletions .test.osc_sim_21.omt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Framework for running automated tests on Open Source Brain
# See https://github.com/OpenSourceBrain/osb-model-validation for more details

target: run_osc_sim_21.py
engine: Brian2 # This installs Brian2, but all we really need is a Python environment to run the script in
mep: .test.osc_sim_21.mep
experiments:
Test2:
observables:
spike times:
file:
path: experiments/osc_sim_21_nml/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0.0

Test3:
observables:
spike times:
file:
path: experiments/osc_sim_21_nml_musc/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0.0
Test4:
observables:
spike times:
file:
path: experiments/osc_sim_21/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0.0
12 changes: 12 additions & 0 deletions .test.osc_sim_21all.mep
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
system: Testing activity of some neurons

experiments:
Test2:
expected:
spike times: [10.105, 12.355, 14.605, 16.855, 19.105]
Test3:
expected:
spike times: [10.105, 12.355, 14.605, 16.855, 19.105]
Test4:
expected:
spike times: [10.105, 12.355, 14.605, 16.855, 19.105]
41 changes: 41 additions & 0 deletions .test.osc_sim_21all.omt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Framework for running automated tests on Open Source Brain
# See https://github.com/OpenSourceBrain/osb-model-validation for more details

target: run_osc_sim_21all.py
engine: Brian2 # This installs Brian2, but all we really need is a Python environment to run the script in
mep: .test.osc_sim_21all.mep
experiments:
Test2:
observables:
spike times:
file:
path: experiments/osc_sim_21all_nml/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0.0

Test3:
observables:
spike times:
file:
path: experiments/osc_sim_21all_nml_musc/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0.0
Test4:
observables:
spike times:
file:
path: experiments/osc_sim_21all/act.dat
columns: [0, 3]
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.5
tolerance: 0.0
11 changes: 9 additions & 2 deletions F2_fig_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import neuromlLocal.utils as utils


def make_fig(plot_format):
def make_fig(model_name):
plot_format = utils.plot_formats[model_name]

file_prefix = "sim_"
if not os.path.isfile(hf.rename_file(file_prefix + "ns.dat")):
file_prefix = ""
Expand Down Expand Up @@ -60,7 +62,9 @@ def make_fig(plot_format):
if "plot_cell_unit" in plot_format:
plot_cell_unit = plot_format["plot_cell_unit"]
plot_col_divs = plot_format["plot_col_divs"]
cell_names = utils.getCellNames(network_json_data)
# cell_names = utils.getCellNames(network_json_data)
cell_names = utils.default_cells[model_name]["names"]

step_size = network_json_data["Evolutionary Optimization Parameters"]["StepSize"][
"value"
]
Expand Down Expand Up @@ -198,6 +202,9 @@ def plot_worm(ax, k):
):
ind1 = utils.getIndOfNthVal(cell, cell_names, plot_cell_unit)
if ind1 is None:
print(cell_names)
print(cell)
print(plot_cell_unit)
print("Index error")
exit()
print("cell ind is ", ind1)
Expand Down
8 changes: 4 additions & 4 deletions RoyalSociety2018/Worm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ Worm::Worm(TVector<double> &v,double output)
void Worm::InitializeState(RandomState &rs)
{
t = 0.0;
n.RandomizeCircuitState(-0.5, 0.5, rs);
h.RandomizeCircuitState(-0.5, 0.5, rs);
//n.RandomizeCircuitState(-0.5, 0.5, rs);
//h.RandomizeCircuitState(-0.5, 0.5, rs);
//n.RandomizeCircuitState(0.4, 0.4, rs); //fix initial conditions
//h.RandomizeCircuitState(0.4, 0.4, rs); //fix initial conditions
/* for (int i = 1; i <= n.size; i++)
for (int i = 1; i <= n.size; i++)
n.SetNeuronState(i, (i-0.5)/n.size);
for (int i = 1; i <= h.size; i++)
h.SetNeuronState(i, (i-0.5)/h.size); */
h.SetNeuronState(i, (i-0.5)/h.size);
b.InitializeBodyState();
m.InitializeMuscleState();
}
Expand Down
Loading
Loading