Python wrapper for running instances of trisurf-ng
Samo Penic
2018-05-06 a2f05726379d1440f8709eb9b81913e1ca72f771
commit | author | age
8ab985 1 from trisurf import trisurf
SP 2 import os
3
4 def combine(Runs,filename="statistics.csv",output="combinedStatistics.csv"):
5     """Runs are those runs of which statistics are to be combined"""
6     data=[]
7     for run in Runs:
8         dir=trisurf.Directory(maindir=run.maindir,simdir=run.subdir)
9         statfile=os.path.join(dir.fullpath(),filename)
10         with open (statfile,"r") as myfile:
11             #lines = [line.rstrip('\n') for line in myfile]
12             data=data+myfile.readlines()[1:]
13
14     with open (output,"w") as output:
15         output.write("Header line placer... Not yet implemented\n")
16         for line in data:
17             output.write(line)
18
19     
20