generating plots
This commit is contained in:
parent
96eb91a91f
commit
6cc2dff872
8
Dockerfile
Normal file
8
Dockerfile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
FROM python:3
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY ./requirements.txt .
|
||||||
|
COPY ./generate_plot.py .
|
||||||
|
|
||||||
|
RUN pip install matplotlib==3.2.1
|
20
Jenkinsfile
vendored
Normal file
20
Jenkinsfile
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
pipeline {
|
||||||
|
agent { dockerfile true }
|
||||||
|
stages {
|
||||||
|
stage('Copy results'){
|
||||||
|
steps {
|
||||||
|
copyArtifacts filter: 'wer.txt, srr.txt',
|
||||||
|
fingerprintArtifacts: true, projectName: 's152203-metrics', selector: lastSuccessful()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Generate and archive plots'){
|
||||||
|
steps {
|
||||||
|
sh 'chmod +x plot.sh'
|
||||||
|
|
||||||
|
sh label: '', script: './plot.sh'
|
||||||
|
archiveArtifacts 'wer.png'
|
||||||
|
archiveArtifacts 'srr.png'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
22
plot.py
Normal file
22
plot.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
|
||||||
|
def read_into_file(file_name: str) -> list:
|
||||||
|
with open(file_name, 'r') as f:
|
||||||
|
return f.read().splitlines()
|
||||||
|
|
||||||
|
|
||||||
|
def generate_plot(data: list, label: str, file_name: str):
|
||||||
|
plt.plot(data)
|
||||||
|
plt.ylabel(label)
|
||||||
|
plt.savefig(file_name)
|
||||||
|
plt.close()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
wer = [float(i) for i in read_into_file('wer-generate.txt')]
|
||||||
|
srr = [float(i) for i in read_into_file('srr-generate.txt')]
|
||||||
|
|
||||||
|
generate_plot(wer, 'WER', 'wer.png')
|
||||||
|
generate_plot(srr, 'SRR', 'srr.png')
|
Loading…
Reference in New Issue
Block a user