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 pandas import Grouper
from matplotlib import pyplot 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 # Plot the timeseries
def plot(header, row): def plot(prefix, header, row):
x = { h : d for (h, d) in zip(header, row)} x = { h : d for (h, d) in zip(header, row)}
jobid = x["jobid"] jobid = x["jobid"]
del x["jobid"] del x["jobid"]
@ -40,7 +41,7 @@ def plot(header, row):
ax[i].set_ylabel(l) ax[i].set_ylabel(l)
pyplot.xlabel("Segment number") pyplot.xlabel("Segment number")
pyplot.savefig("timeseries" + jobid + ".png") pyplot.savefig(prefix + "timeseries" + jobid + ".png")
# Plot first 30 minutes # Plot first 30 minutes
@ -49,8 +50,9 @@ def plot(header, row):
ax[i].set_ylabel(l) ax[i].set_ylabel(l)
pyplot.xlabel("Segment number") 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: if not row[0].strip() in jobs:
continue continue
else: else:
plot(header, row) plot(prefix, header, row)

View File

@ -50,6 +50,14 @@ plotJobs = function(jobs){
#print(tbl) #print(tbl)
md = metadata[metadata$jobid %in% jobs,] md = metadata[metadata$jobid %in% jobs,]
print(summary(md)) 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 # Store the job ids in a table, each column is one algorithm