Skip to content

Commit

Permalink
Toss edges in input with zero weights
Browse files Browse the repository at this point in the history
  • Loading branch information
drummerdoc committed Jul 29, 2020
1 parent 438868c commit 6708bb4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions chemPathTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6708bb4

Please sign in to comment.