From 67749cb5e94a7d28a449a8346b8b3efad786e765 Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@gmail.com> Date: Wed, 01 Jun 2016 19:27:58 +0000 Subject: [PATCH] Added statistics combining python script. Rudimentary at the moment. --- /dev/null | 14 -------------- python/myTestConfig.py | 6 +++--- python/trisurf/statistics.py | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/python/myTestConfig.py b/python/myTestConfig.py index 7a90ea8..1f3b547 100755 --- a/python/myTestConfig.py +++ b/python/myTestConfig.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 from trisurf import tsmgr from trisurf import trisurf - +from trisurf import statistics print("Running trisurf version "+ tsmgr.getTrisurfVersion()) @@ -29,5 +29,5 @@ #obligatory final configuration step: combine all runs Runs=[run1,run2]+pRun #start manager with configured runs -tsmgr.start(Runs) - +#tsmgr.start(Runs) +statistics.combine([run1,run2]) diff --git a/python/paramikoTest.py b/python/paramikoTest.py deleted file mode 100755 index feae0d7..0000000 --- a/python/paramikoTest.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/python3 -import paramiko - -ssh = paramiko.SSHClient() -#ssh.load_host_keys(os.path.expanduser(os.path.join("~", ".ssh", "known_hosts"))) -ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) -ssh.connect('hostname', username='', password='',port=22,timeout=5) -stdin, stdout, stderr = ssh.exec_command('df -h') -x=stdout.readlines() -sftp = ssh.open_sftp() -#sftp.put(localpath, remotepath) -sftp.close() -ssh.close() -print (x) diff --git a/python/trisurf/statistics.py b/python/trisurf/statistics.py new file mode 100644 index 0000000..9b3d454 --- /dev/null +++ b/python/trisurf/statistics.py @@ -0,0 +1,19 @@ +from trisurf import trisurf +import os + +def combine(Runs): + """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") + with open (statfile,"r") as myfile: + #lines = [line.rstrip('\n') for line in myfile] + data=data+myfile.readlines()[1:] + + print("Header line placer... Not yet implemented") + for line in data: + print(line.replace('\n','')) + + + -- Gitblit v1.9.3