Trisurf Monte Carlo simulator
Samo Penic
2016-06-02 08a4a2072e2248696eeb2a5cf93a8bcb90390596
Modification in statistics.py -- filename can be specified to be ulm2.csv, for example. Also, output filename can be specified
1 files modified
6 ■■■■ changed files
python/trisurf/statistics.py 6 ●●●● patch | view | raw | blame | history
python/trisurf/statistics.py
@@ -1,17 +1,17 @@
from trisurf import trisurf
import os
def combine(Runs):
def combine(Runs,filename="statistics.csv",output="combinedStatistics.csv"):
    """Runs are those runs of which statistics are to be combined"""
    data=[]
    for run in Runs:
        dir=trisurf.Directory(maindir=run.maindir,simdir=run.subdir)
        statfile=os.path.join(dir.fullpath(),"statistics.csv")
        statfile=os.path.join(dir.fullpath(),filename)
        with open (statfile,"r") as myfile:
            #lines = [line.rstrip('\n') for line in myfile]
            data=data+myfile.readlines()[1:]
    with open ("combinedStatistics.csv","w") as output:
    with open (output,"w") as output:
        output.write("Header line placer... Not yet implemented\n")
        for line in data:
            output.write(line)