From cf51b46a7ef09d6b80ef4a8086e57ed68cebfec1 Mon Sep 17 00:00:00 2001 From: pgleeson Date: Mon, 16 Dec 2024 17:30:11 +0000 Subject: [PATCH] Fix issue when id names are from quantities containing slashes - replace / with _ --- neuromllite/NetworkGenerator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neuromllite/NetworkGenerator.py b/neuromllite/NetworkGenerator.py index ed5fbb5..16e8906 100644 --- a/neuromllite/NetworkGenerator.py +++ b/neuromllite/NetworkGenerator.py @@ -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]