Skip to content

Commit a4f47df

Browse files
committed
Restructure main test file
Tidy load_data.py
1 parent cac73c1 commit a4f47df

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

.github/workflows/ci-make.yml

+4-12
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ jobs:
2828
run: g++ -v
2929

3030
- name: Install dependencies (Ubuntu)
31-
run: sudo apt-get install -y nlohmann-json3-dev
31+
run: sudo apt-get install -y nlohmann-json3-dev tree
3232
if: ${{ contains(matrix.runs-on, 'ubuntu') }}
3333

3434
- name: Install dependencies (macOS)
35-
run: brew install nlohmann-json
35+
run: brew install nlohmann-json tree
3636
if: ${{ contains(matrix.runs-on, 'macos') }}
3737

3838
- name: Run C++ tests
@@ -54,15 +54,6 @@ jobs:
5454
pip install pyNeuroML
5555
pip install numpy matplotlib
5656
pip install ruff
57-
58-
59-
60-
- name: Test NeuroML
61-
run: |
62-
cd neuromlLocal
63-
./regenerate.sh
64-
65-
# make clean all # not yet...
6657
6758
- name: Test directly running main program
6859
run: |
@@ -79,11 +70,12 @@ jobs:
7970
export NEURON_HOME=$pythonLocation
8071
env
8172
82-
./test_all.sh
73+
./test_all.sh # also generated neuroml
8374
8475
git diff exampleRun/phenotype.dat
8576
8677
8778
- name: list generated files
8879
run: |
8980
ls -alth
81+
tree

load_data.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55

66
import numpy as np
77
from matplotlib import pyplot as plt
8-
#import random
8+
9+
# import random
910
import helper_funcs as hf
1011

1112

12-
def reload_single_run(show_plot=True):
13+
def reload_single_run(show_plot=True, verbose=False):
14+
1315
N_muscles = 24 # Number of muscles alongside the body
1416
N_units = 10 # Number of neural units in VNC
1517
N_neuronsperunit = 6 # Number of neurons in a VNC neural unit (6 neurons)
@@ -36,7 +38,7 @@ def reload_single_run(show_plot=True):
3638
act_data[0], act_data[i], label="SR %i" % (i - offset), linewidth=0.5
3739
)
3840
axs[0, 0].xaxis.set_ticklabels([])
39-
plt.legend()
41+
#plt.legend()
4042

4143
axs[0, 1].imshow(sr, aspect="auto", interpolation="nearest")
4244
axs[0, 1].xaxis.set_ticklabels([])
@@ -49,7 +51,7 @@ def reload_single_run(show_plot=True):
4951
act_data[0], act_data[i], label="Neu %i" % (i - offset), linewidth=0.5
5052
)
5153
axs[1, 0].xaxis.set_ticklabels([])
52-
plt.legend()
54+
#plt.legend()
5355

5456
neu = act_data[offset : N_neurons + offset]
5557
axs[1, 1].imshow(neu, aspect="auto", interpolation="nearest")
@@ -63,7 +65,7 @@ def reload_single_run(show_plot=True):
6365
act_data[0], act_data[i], label="Mu %i" % (i - offset), linewidth=0.5
6466
)
6567
axs[2, 0].xaxis.set_ticklabels([])
66-
plt.legend()
68+
#plt.legend()
6769

6870
mus = act_data[offset : N_muscles + offset]
6971
axs[2, 1].imshow(mus, aspect="auto", interpolation="nearest")
@@ -92,14 +94,14 @@ def reload_single_run(show_plot=True):
9294
f = float(t) / tmax
9395

9496
color = "#%02x%02x00" % (int(0xFF * (f)), int(0xFF * (1 - f) * 0.8))
95-
#color2 = "#%06x" % random.randint(0, 0xFFFFFF)
97+
# color2 = "#%06x" % random.randint(0, 0xFFFFFF)
9698

9799
point_start = 1
98100
for i in range(point_start, 50):
99101
x = body_data[i * 3 + 1][t]
100102
y = body_data[i * 3 + 2][t]
101-
#y1 = body_data[i * 3 + 2][t]
102-
if i == 1:
103+
# y1 = body_data[i * 3 + 2][t]
104+
if i == 1 and verbose:
103105
print(
104106
"%s + Plotting %i at t=%s (%s,%s), %s"
105107
% ("\n" if i == point_start else "", i, t, x, y, color)

0 commit comments

Comments
 (0)