Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CPUnetPLOT
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CPUnetLOG
CPUnetPLOT
Commits
114a6a8a
Commit
114a6a8a
authored
Nov 20, 2015
by
Mario Hock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common_base_time, optional color parameter
parent
b9cb37f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
cnl_library.py
cnl_library.py
+17
-0
cnl_plot.py
cnl_plot.py
+7
-3
No files found.
cnl_library.py
View file @
114a6a8a
...
...
@@ -17,6 +17,23 @@ import csv
import
os
def
get_common_base_time
(
cnl_files
):
base_times
=
list
()
for
file
in
cnl_files
:
if
(
type
(
file
)
==
str
):
cnl_file
=
CNLParser
(
file
)
else
:
cnl_file
=
file
base_times
.
append
(
cnl_file
.
get_machine_readable_date
()
)
common_base_time
=
min
(
base_times
)
return
common_base_time
def
human_readable_from_seconds
(
seconds
):
if
(
seconds
==
0
):
return
"0"
...
...
cnl_plot.py
View file @
114a6a8a
...
...
@@ -102,11 +102,15 @@ def get_min_max_x(cnl_file):
def
plot
(
ax
,
x_values
,
cols
,
active_cols
,
col_labels
,
alpha
,
**
kwargs
):
def
plot
(
ax
,
x_values
,
cols
,
active_cols
,
col_labels
,
alpha
,
color
=
None
,
**
kwargs
):
#use_ema = kwargs.get("use_ema")
ema_only
=
kwargs
.
get
(
"ema_only"
)
smooth
=
kwargs
.
get
(
"smooth"
)
plot_kws
=
dict
()
if
(
color
):
plot_kws
[
"color"
]
=
color
for
col_name
,
col_label
in
zip
(
active_cols
,
col_labels
):
data
=
cols
[
col_name
]
if
(
len
(
x_values
)
==
len
(
data
)
*
2
):
...
...
@@ -114,11 +118,11 @@ def plot(ax, x_values, cols, active_cols, col_labels, alpha, **kwargs):
# * plot *
if
(
not
ema_only
):
ax
.
plot
(
x_values
,
data
,
label
=
col_label
,
alpha
=
alpha
)
ax
.
plot
(
x_values
,
data
,
label
=
col_label
,
alpha
=
alpha
,
**
plot_kws
)
## plot ema
if
(
ema_only
and
smooth
):
ax
.
plot
(
x_values
,
calc_ema
(
data
,
smooth
),
label
=
col_label
)
ax
.
plot
(
x_values
,
calc_ema
(
data
,
smooth
),
label
=
col_label
,
**
plot_kws
)
def
plot_net
(
ax
,
cnl_file
,
args
,
layout
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment