From 6708bb454db71527a9f00777ebf7b5025272dc43 Mon Sep 17 00:00:00 2001 From: Marc Day Date: Tue, 28 Jul 2020 23:11:28 -0700 Subject: [PATCH] Toss edges in input with zero weights --- chemPathTool.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chemPathTool.py b/chemPathTool.py index 64c6980..fc6c62f 100644 --- a/chemPathTool.py +++ b/chemPathTool.py @@ -1524,9 +1524,11 @@ def doReadEDat(self,ifile): for line in lines[2:]: vals = line.strip().split() if (len(vals) == 4): - edgeVals.append((vals[0],vals[1],float(vals[2]),float(vals[3]))) + if ( (float(vals[2]) != 0) | (float(vals[3]) != 0) ): + edgeVals.append((vals[0],vals[1],float(vals[2]),float(vals[3]))) elif (len(vals) == 3): - edgeVals.append((vals[0],vals[1],float(vals[2]),0.0)) + if (float(vals[2]) != 0): + edgeVals.append((vals[0],vals[1],float(vals[2]),0.0)) else: print 'bad input line - expecting 2 strings, and either one or two floats.' print 'Found: ',line