Skip to content

Commit

Permalink
Fixed, but CSV input to Neuron NF
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Plagge committed Apr 26, 2017
1 parent 533aeaa commit 6843e4b
Show file tree
Hide file tree
Showing 11 changed files with 481 additions and 1,876 deletions.
41 changes: 17 additions & 24 deletions scripts/NeMo_TN.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,23 @@ def read(params, modelf, spikef):
spikec = output_name + "_spike.csv"

if (params.fread) or not os.path.exists(loadfile):
with click.progressbar(length=100, label="Processing JSON") as bar:
click.echo("Starting JSON load (will take some time)")
bar.update(5)
df = createNeMoCFGFromJson(modelf)
bar.update(70)
df.save_csv(tempfile)
with open(tempfile, 'r') as f:
fdat = f.readlines()
cores = fdat[0]
with open(loadfile, 'w') as o:

o.writelines(fdat[2:])
bar.update(10)

#todo: remove temp file
spikes = readSpikeFile(spikef, 'json')

bar.update(5)
csv = [x.toCSV() for x in spikes]
with open(spikec, 'w') as f:
for l in csv:
f.write(l)
bar.update(10)
params.cores = cores
# with click.progressbar(length=100, label="Processing JSON") as bar:
click.echo("Starting JSON load (will take some time)")

df = createNeMoCFGFromJson(modelf)

df.save_csv(tempfile)
with open(tempfile, 'r') as f:
fdat = f.readlines()
cores = fdat[0]
with open(loadfile, 'w') as o:

o.writelines(fdat[2:])


#todo: remove temp file
spikes = readAndSaveSpikeFile(filename=spikef, saveFile=spikec)
params.cores = cores


@click.command()
Expand Down
514 changes: 258 additions & 256 deletions scripts/test/ex1.csv

Large diffs are not rendered by default.

Loading

0 comments on commit 6843e4b

Please sign in to comment.