From cc1a929ea326cb27e13b045de9e54dc1f602cb17 Mon Sep 17 00:00:00 2001 From: Ufnow Date: Wed, 22 Apr 2020 00:45:51 +0200 Subject: [PATCH] wykresy --- JenkinsfilePlots | 35 +++++++++++++++++++++++++++++++++++ wykres.py | 26 ++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 JenkinsfilePlots create mode 100644 wykres.py diff --git a/JenkinsfilePlots b/JenkinsfilePlots new file mode 100644 index 0000000..6ae582f --- /dev/null +++ b/JenkinsfilePlots @@ -0,0 +1,35 @@ +pipeline { + agent { dockerfile true } + stages { + stage('checkoutGit') { + steps { + git 'https://git.wmi.amu.edu.pl/s426274/s426274-mlworkshops' + } + } + + stage('CopyArtifacts') + { + stage('copyArtifacts') { + steps { + copyArtifacts filter: 'wer.txt', fingerprintArtifacts: true, projectName: 'ASR-eval', selector: lastSuccessful(), target: './' + copyArtifacts filter: 'srr.txt', fingerprintArtifacts: true, projectName: 'ASR-eval', selector: lastSuccessful(), target: './' + } + } + } + stage('Plots') + { + steps { + sh label: 'WER plot', script: './wykresy.py wer.txt wer.png' + sh label: 'SRR plot', script: './wykresy.py srr.txt srr.png' + } + } + stage('ArchiveArtifacts') + { + steps { + archiveArtifacts 'wer.png' + archiveArtifacts 'srr.png' + } + } + + } +} \ No newline at end of file diff --git a/wykres.py b/wykres.py new file mode 100644 index 0000000..40f00c7 --- /dev/null +++ b/wykres.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + +fig_wer, ax_wer = plt.subplots() +fig_srr, ax_srr = plt.subplots() + +X1, Y1 = [], [] +X2, Y2 = [], [] +y_num=1 +for line in open('wer.txt', 'r'): + Y1.append(float(line[:-1])) + X1.append(y_num) + y_num=y_num+1 + +ax_wer.plot(X1, Y1) +ax_wer.set_title("WER") +fig_wer.savefig('wer.png') + +y_num=1 +for line in open('srr.txt', 'r'): + Y2.append(float(line[:-1])) + X2.append(y_num) + y_num=y_num+1 + +ax_srr.plot(X2, Y2) +ax_srr.set_title("SRR") +fig_srr.savefig('srr.png') \ No newline at end of file