Skip to content

Commit

Permalink
write result correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
skoudoro committed Aug 3, 2023
1 parent 231e01c commit f74a232
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions quantconn/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import csv
import os
from os.path import join as pjoin
from pathlib import Path
Expand Down Expand Up @@ -254,10 +255,13 @@ def merge(destination: Annotated[Path, typer.Option("--destination", "-dest",
print(f"Shape Similarity score : {icc_ss.round(3)}")

# Save results
res = np.asarray([icc_con, icc_mm, icc_ss])
header = 'betweenness_centrality, global_efficiency, modularity'
np.savetxt(pjoin(destination, '_final_sore.csv'), res, delimiter=',',
header=header)
with open(pjoin(destination, '_final_sore.csv'), 'w') as fh:
writer = csv.writer(fh, delimiter=',')
writer.writerow(['betweenness_centrality', 'global_efficiency',
'modularity'])
writer.writerow([float(icc_con.round(3)),
float(icc_mm.round(3)),
float(icc_ss.round(3))])

print(":green_circle: [bold green]Success ! :love-you_gesture: [/bold green]")

Expand Down

0 comments on commit f74a232

Please sign in to comment.