Plot the 100 jobs.

This commit is contained in:
Julian M. Kunkel 2020-08-18 15:26:29 +01:00
parent 343b77a036
commit 138cdaa363
2 changed files with 16 additions and 6 deletions

View File

@ -6,12 +6,13 @@ from pandas import DataFrame
from pandas import Grouper
from matplotlib import pyplot
jobs = sys.argv[1:]
jobs = [sys.argv[1]]
prefix = sys.argv[2]
print("Analyzing the jobs: " + str(jobs))
print("Plotting the job: " + str(jobs))
# Plot the timeseries
def plot(header, row):
def plot(prefix, header, row):
x = { h : d for (h, d) in zip(header, row)}
jobid = x["jobid"]
del x["jobid"]
@ -40,7 +41,7 @@ def plot(header, row):
ax[i].set_ylabel(l)
pyplot.xlabel("Segment number")
pyplot.savefig("timeseries" + jobid + ".png")
pyplot.savefig(prefix + "timeseries" + jobid + ".png")
# Plot first 30 minutes
@ -49,8 +50,9 @@ def plot(header, row):
ax[i].set_ylabel(l)
pyplot.xlabel("Segment number")
pyplot.savefig("timeseries" + jobid + "-30.png")
pyplot.savefig(prefix + "timeseries" + jobid + "-30.png")
### end plotting function
@ -66,4 +68,4 @@ with open('job-io-datasets/datasets/job_codings.csv') as csv_file:
if not row[0].strip() in jobs:
continue
else:
plot(header, row)
plot(prefix, header, row)

View File

@ -50,6 +50,14 @@ plotJobs = function(jobs){
#print(tbl)
md = metadata[metadata$jobid %in% jobs,]
print(summary(md))
# print the job timeline
r = e[ordered, ]
for (row in 1:length(jobs)) {
prefix = sprintf("%s-%f-%.0f", level, r[row, "similarity"], row)
job = r[row, "jobid"]
system(sprintf("scripts/plot-single-job.py %s %s", job, prefix))
}
}
# Store the job ids in a table, each column is one algorithm