From 5f0be79461ec29850de775b0d22d85759f55267c Mon Sep 17 00:00:00 2001 From: Adrianna Zaleska Date: Sun, 19 Apr 2020 21:26:28 +0200 Subject: [PATCH] plots --- Dockerfile | 8 ++++---- Jenkinsfile | 4 +++- script.py | 25 +++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8c13884..cf6bc0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,8 @@ RUN apt install -y git RUN apt install -y gcc RUN gcc --version RUN apt install -y build-essential -RUN git clone https://github.com/usnistgov/SCTK.git -WORKDIR SCTK -RUN make config && make all && make check && make install && make doc -ENV PATH=$PATH:/SCTK/bin +RUN apt install -y python3 +RUN apt install -y python3-pip +RUN pip install matplotlib + diff --git a/Jenkinsfile b/Jenkinsfile index e148334..95037ad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,9 @@ pipeline { copyArtifacts filter: 'wer.txt', fingerprintArtifacts: true, projectName: 's416296-metrics', selector: lastSuccessful() copyArtifacts filter: 'srr.txt', fingerprintArtifacts: true, projectName: 's416296-metrics', selector: lastSuccessful() sh label: '', script: 'chmod a+rwx script.py' - sh label: '', script: './script.py' + sh label: '', script: 'python script.py' + archiveArtifacts 'wer.png' + archiveArtifacts 'srr.png' } } diff --git a/script.py b/script.py index e69de29..80b3cfb 100644 --- a/script.py +++ b/script.py @@ -0,0 +1,25 @@ +import matplotlib.pyplot as plt + +fig_wer, fig_srr = plt.subplots() + +X1, Y1 = [], [] +X2, Y2 = [], [] +y_num=1 +for line in open('wer.txt', 'r'): + X1.append(line) + Y1.append(y_num) + y_num=y_num+1 + +fig_wer.plot(X1, Y1) +fig_wer.set_title("WER") +fig_wer.savefig('wer.png') + +y_num=1 +for line in open('srr.txt', 'r'): + X2.append(line) + Y2.append(y_num) + y_num=y_num+1 + +fig_srr.plot(X2, Y2) +fig_srr.set_title("SRR") +fig_srr.savefig('srr.png') \ No newline at end of file