Skip to content

Commit

Permalink
Fixed empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjorthmedh committed Dec 1, 2023
1 parent b531389 commit 53c3205
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion snudda/input/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import h5py
import numexpr
import re
import numpy as np

from snudda.utils.snudda_path import get_snudda_data
Expand Down Expand Up @@ -376,10 +377,13 @@ def write_hdf5(self):
spike_row = neuron_id

if "spikeData" not in self.neuron_input[neuron_id][input_type]:
float_pattern = re.compile(r'^[-+]?[0-9]*\.?[0-9]+$')

s_data = []
with open(spike_file, "rt") as f:
for row in f:
s_data.append(np.array([float(x) for x in row.split(" ") if len(x) > 0]))
s_data.append(np.array([float(x) for x in row.split(" ")
if len(x) > 0 and float_pattern.match(x)]))

self.neuron_input[neuron_id][input_type]["spikeData"] = s_data

Expand Down

0 comments on commit 53c3205

Please sign in to comment.