werwer
This commit is contained in:
parent
d27d2d8fd9
commit
834923aecb
@ -18,8 +18,10 @@ pipeline {
|
|||||||
stage('Plots')
|
stage('Plots')
|
||||||
{
|
{
|
||||||
steps {
|
steps {
|
||||||
sh label: 'WER plot', script: './wykres.py wer.txt wer.png'
|
sh label: '', script: 'chmod a+rwx script.py'
|
||||||
sh label: 'SRR plot', script: './wykres.py srr.txt srr.png'
|
sh label: '', script: 'python3 wykres.py'
|
||||||
|
archiveArtifacts 'wer.png'
|
||||||
|
archiveArtifacts 'srr.png'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('ArchiveArtifacts')
|
stage('ArchiveArtifacts')
|
||||||
|
51
wykres.py
51
wykres.py
@ -1,37 +1,26 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import sys
|
|
||||||
|
|
||||||
|
fig_wer, ax_wer = plt.subplots()
|
||||||
|
fig_srr, ax_srr = plt.subplots()
|
||||||
|
|
||||||
def read_file(filename):
|
X1, Y1 = [], []
|
||||||
values = []
|
X2, Y2 = [], []
|
||||||
with open(filename) as f:
|
y_num=1
|
||||||
for line in f:
|
for line in open('wer.txt', 'r'):
|
||||||
values.append(float(line.rstrip('\n')))
|
Y1.append(float(line[:-1]))
|
||||||
return values
|
X1.append(y_num)
|
||||||
|
y_num=y_num+1
|
||||||
|
|
||||||
|
ax_wer.plot(X1, Y1)
|
||||||
|
ax_wer.set_title("WER")
|
||||||
|
fig_wer.savefig('wer.png')
|
||||||
|
|
||||||
def main():
|
y_num=1
|
||||||
input_file = sys.argv[1]
|
for line in open('srr.txt', 'r'):
|
||||||
output_file = sys.argv[2]
|
Y2.append(float(line[:-1]))
|
||||||
|
X2.append(y_num)
|
||||||
|
y_num=y_num+1
|
||||||
|
|
||||||
# Get values
|
ax_srr.plot(X2, Y2)
|
||||||
values = read_file(input_file)
|
ax_srr.set_title("SRR")
|
||||||
|
fig_srr.savefig('srr.png')
|
||||||
# Setup values
|
|
||||||
plt.plot(values)
|
|
||||||
|
|
||||||
# Set x-label to 'executes'
|
|
||||||
plt.xlabel('executes')
|
|
||||||
|
|
||||||
# Set y-label to 'executes'
|
|
||||||
ylabel_name = input_file.split('.')[0]
|
|
||||||
plt.ylabel(ylabel_name)
|
|
||||||
|
|
||||||
# Save fig with 800 dpi
|
|
||||||
plt.savefig(output_file, dpi=800)
|
|
||||||
plt.close()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
Loading…
Reference in New Issue
Block a user