Skip to content

Commit

Permalink
Fix empty line issue #99 this closes #99 contributed by @bengum
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismattmann committed Mar 19, 2023
1 parent bc71c79 commit 3529ee4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tikasimilarity/cluster/edit-cosine-circle-packing.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def createCluster(inputCSV,argNum):
# handling case where file names have space in between them
lines = [line.strip() for line in f]
for line in lines:
if not len(line):
continue
row.append(line)

data={}
Expand Down Expand Up @@ -64,7 +66,7 @@ def createCluster(inputCSV,argNum):
i+=1


print(json.dumps(clusterList, sort_keys=True, indent=4, separators=(',', ': ')))
#print(json.dumps(clusterList, sort_keys=True, indent=4, separators=(',', ': ')))

clusterStruct = {"name":"clusters", "children":clusterList}
with open("circle.json", "w") as f: #Pass the json file as input to circle-packing.html
Expand Down
4 changes: 3 additions & 1 deletion tikasimilarity/cluster/edit-cosine-cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def createCluster(inputCSV,argNum):
with open(csvPath,"r") as f:
lines = [line.strip() for line in f]
for line in lines:
if not len(line):
continue
row.append(line)

data={}
Expand Down Expand Up @@ -64,7 +66,7 @@ def createCluster(inputCSV,argNum):
i+=1


print(json.dumps(clusterList, sort_keys=True, indent=4, separators=(',', ': ')))
#print(json.dumps(clusterList, sort_keys=True, indent=4, separators=(',', ': ')))

clusterStruct = {"name":"clusters", "children":clusterList}
with open("clusters.json", "w") as f: #Pass the json file as input to cluster-d3.html or dynamic-cluster.html
Expand Down

0 comments on commit 3529ee4

Please sign in to comment.