Skip to content

Commit

Permalink
GitHub Actions debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
C.A.P. Linssen committed May 3, 2021
1 parent ff08892 commit 3a5a5fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/nestbuildmatrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
cpp_compiler: "clang"

steps:
- uses: actions/checkout@v2

# Steps represent a sequence of tasks that will be executed as part of the job
- name: Checkout repo content
Expand Down Expand Up @@ -137,3 +138,8 @@ jobs:
python extras/parse_build_log.py gha_build.sh.log ${{ github.workspace }}
env:
xNEST_BUILD_TYPE: FULL

- name: tmate
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3

14 changes: 13 additions & 1 deletion pynest/nest/tests/test_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@ def voltage_trace_verify(self, device):
x_data, y_data = line.get_data()
# Check that times are correct
self.assertEqual(list(x_data), list(np.unique(device.get('events', 'times'))))
print("times:")
print(x_data)
print(list(np.unique(device.get('events', 'times'))))
# Check that voltmeter data corresponds to the lines in the plot
self.assertTrue(all(np.isclose(ref_vm, y_data)))
print("v_m:")
print(ref_vm)
print(y_data)
plt.close(ax.get_figure())

@unittest.skipIf(not PLOTTING_POSSIBLE, 'Plotting impossible because matplotlib or display missing')
Expand All @@ -102,21 +108,27 @@ def test_voltage_trace_from_device(self):
device = nest.Create('voltmeter')
nest.Connect(pg, nodes)
nest.Connect(device, nodes)
wfwf = nest.Create('spike_recorder')
nest.Connect(pg,wfwf)
nest.Simulate(100)

# Test with data from device
print("From device:--------------------------------------")
nest.voltage_trace.from_device(device)
self.voltage_trace_verify(device)

# Test with fata from file
# Test with data from file
vm = device.get('events')
data = np.zeros([len(vm['senders']), 3])
data[:, 0] = vm['senders']
data[:, 1] = vm['times']
data[:, 2] = vm['V_m']
filename = os.path.join(self.nest_tmpdir(), 'voltage_trace.txt')
self.filenames.append(filename)
print("FILENAME::::::::::::::::: " + str(filename))
np.savetxt(filename, data)

print("From file:--------------------------------------")
nest.voltage_trace.from_file(filename)
self.voltage_trace_verify(device)

Expand Down

0 comments on commit 3a5a5fa

Please sign in to comment.