Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add user breakdown areas to cumu and insta plot functions. #6

Merged
merged 1 commit into from
May 4, 2020

Conversation

jadesjardins
Copy link
Collaborator

Maybe get_user_run.py could just be integrated within job_use.py.. I would be interested in your opinion. Here is an example script using it the way that it is in this commit:

import numpy as np
import pandas as pd
import viewclust as vc
import ccmnt
import pickle
import datetime as dt
from viewclust import slurm
from viewclust.target_series import target_series

import plotly.graph_objects as go

d_from = '2020-01-01T00:00:00'
d_from_drop = '2019-12-01T00:00:00'
d_to = '2020-04-01T00:00:00'
account = 'def-yeaman_cpu'
target = 50
system = 'graham'
file_tag = '20q4'

job_frame = ccmnt.get_jobs(d_from, d_to, account_query=account, system = system, serialize_frame='', debugging=False)
job_frame['mem'] = job_frame['reqmem_mb']
job_frame['ncpus'] = job_frame['reqcpus']

print(len(job_frame))

clust_target, queued, running, delta = vc.job_use(job_frame, d_from, target, d_to=d_to, use_unit='cpu')

user_running_cat = vc.get_users_run(job_frame, d_from, target, d_to=d_to, use_unit='cpu')

queued=queued[d_from:d_to]
running=running[d_from:d_to]
vc.insta_plot(clust_target, queued, running, fig_out=system + '' + file_tag + '' + account + 'insta_plot.html', query_bounds=False, user_run=user_running_cat)
vc.cumu_plot(clust_target, queued, running, fig_out=system + '
' + file_tag + '_' + account + '_cumu_plot.html', query_bounds=False, user_run=user_running_cat)

@Andesha
Copy link
Owner

Andesha commented May 4, 2020

going to merge this in as we discussed in slack...

Honestly, in the future we should consider a rework to using more aggregate data frames as opposed to returning multiple series. This sort of thing would break old frameworks, but it's worth considering in the future.

@Andesha
Copy link
Owner

Andesha commented May 4, 2020

Additionally - I intended to add more features shortly, it might be a bit before the next version is pushed.

@Andesha Andesha merged commit 08e1e5c into master May 4, 2020
@Andesha Andesha deleted the user_area branch May 4, 2020 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants