Skip to content

Commit 5d83d87

Browse files
committed
Added new regexes to detect trace function.
1 parent 6e237e6 commit 5d83d87

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

optimizer/traceHandler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ def detect_format(self,line):
217217
#TODO
218218
#need more rule for spike timings and other
219219
pynn_rule=re.compile("# variable = [a-zA-Z]")
220-
neuron_rule_time=re.compile("[0-9]*(.[0-9]*)?\s-?[0-9]*(.[0-9]*)?")
221-
neuron_rule=re.compile("-?[0-9]*(.[0-9]*)?$|(-?[0-9]*(.[0-9]*)?\t)")
220+
neuron_rule_time=re.compile("[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s-?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?")
221+
neuron_rule=re.compile("-?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$|(-?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\t)")
222222
spike_times_rule=re.compile("# variable = spikes")
223223
rules=[pynn_rule,neuron_rule_time,neuron_rule,spike_times_rule]
224224
result=[n!=None for n in [re.match(k,line) for k in rules ] ]

0 commit comments

Comments
 (0)