Skip to content

Commit

Permalink
Fix issue when id names are from quantities containing slashes - repl…
Browse files Browse the repository at this point in the history
…ace / with _
  • Loading branch information
pgleeson committed Dec 16, 2024
1 parent 39ba27b commit cf51b46
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions neuromllite/NetworkGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2105,12 +2105,13 @@ def get_source_id(spiketrain):
size = evaluate(p.size, network.parameters)
for i in range(size):
quantity = "%s/%i/%s/%s" % (p.id, i, p.component, var)
safe_var = var.replace("/", "_")

if not p.has_positions():
quantity = "%s[%i]/%s" % (p.id, i, var)
gen_plots_for_quantities[
"%s_%i_%s" % (p.id, i, var)
"%s_%i_%s" % (p.id, i, safe_var)
] = [quantity]
safe_var = var.replace("/", "_")
gen_saves_for_quantities[
"%s_%i.%s.dat" % (p.id, i, safe_var)
] = [quantity]
Expand Down

0 comments on commit cf51b46

Please sign in to comment.