From 551ad3540dd544995b39a988fb651ceb37a4ed4a Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Tue, 19 Dec 2023 12:46:53 +0000
Subject: [PATCH] Don't throw an error when analysing if no nuuron-muscel
connections
---
c302/NeuroMLUtilities.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/c302/NeuroMLUtilities.py b/c302/NeuroMLUtilities.py
index d149c027..3af2715b 100644
--- a/c302/NeuroMLUtilities.py
+++ b/c302/NeuroMLUtilities.py
@@ -105,7 +105,8 @@ def analyse_connections(cells, neuron_conns, neurons2muscles, muscles, muscle_co
print_("Found %i neurons connected to muscles: %s\n"%(len(neurons2muscles), sorted(neurons2muscles)))
print_("Found %i muscles connected to neurons: %s\n"%(len(muscles), sorted(muscles)))
- print_("Found %i connections between neurons and muscles, e.g. %s\n"%(len(muscle_conns), muscle_conns[0]))
+
+ print_("Found %i connections between neurons and muscles%s\n"%(len(muscle_conns), (', e.g. %s'%muscle_conns[0]) if len(muscle_conns)>0 else ''))
nts = {}
nts_tot = {}