Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fastNLO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
qcd-public
fastNLO
Commits
55a667cb
Commit
55a667cb
authored
2 years ago
by
Klaus Rabbertz
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug in channel ordering for event rate plot
parent
11fd3a40
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/plotting/fastnnlo_runtime.py
+12
-20
12 additions, 20 deletions
tools/plotting/fastnnlo_runtime.py
with
12 additions
and
20 deletions
tools/plotting/fastnnlo_runtime.py
+
12
−
20
View file @
55a667cb
...
...
@@ -173,26 +173,22 @@ def get_files(files):
def
get_loginformation
(
files
):
# always in hours for simplicity
runtimes
=
[]
unit
=
'
hours
'
for
file
in
files
:
runtimes_temp
=
[]
with
open
(
file
)
as
origin
:
for
line
in
origin
:
# extract elapsed time
with time unit
# extract elapsed time
in hours
if
'
Time elapsed
'
in
line
:
line
=
line
.
split
(
'
:
'
)
hours
=
float
(
line
[
1
])
minutes
=
float
(
line
[
2
])
seconds
=
float
(
line
[
3
])
if
hours
!=
0.
:
runtimes_temp
.
append
(
hours
+
minutes
/
60
+
seconds
/
360
)
unit
=
'
hours
'
else
:
runtimes_temp
.
append
(
minutes
+
seconds
/
60
)
unit
=
'
minutes
'
runtimes_temp
.
append
(
hours
+
minutes
/
60
+
seconds
/
3600
)
runtimes
.
append
(
runtimes_temp
[
-
1
])
...
...
@@ -235,7 +231,7 @@ def get_runinformation(files):
def
plot_elapsed_time
(
infodict
,
out_path
,
out_name
,
formats
):
times
=
infodict
[
'
runtime
'
]
unit
=
infodict
[
'
runtime_unit
'
]
unit
=
infodict
[
'
runtime_unit
'
]
channels
=
infodict
[
'
channels
'
]
events
=
infodict
[
'
events
'
]
...
...
@@ -252,7 +248,7 @@ def plot_elapsed_time(infodict, out_path, out_name, formats):
median
=
np
.
median
(
times
)
iqd
=
np
.
subtract
(
*
np
.
percentile
(
times
,
[
75
,
25
],
interpolation
=
'
linear
'
))
/
2.
CPUtime
=
np
.
sum
(
times
)
/
(
1
if
unit
==
'
hours
'
else
60
)
CPUtime
=
np
.
sum
(
times
)
# set figure
fig
=
plt
.
figure
(
figsize
=
(
16
,
12
))
...
...
@@ -314,10 +310,7 @@ def plot_events_per_hour(infodict, out_path, out_name, formats):
exit
(
11
)
eph
=
[]
for
i
,
time
in
enumerate
(
times
):
if
unit
==
'
hours
'
:
eph
.
append
(
float
(
events
[
i
])
/
time
)
else
:
eph
.
append
(
float
(
events
[
i
])
/
(
time
/
60
))
eph
.
append
(
float
(
events
[
i
])
/
time
)
ephchn
=
[]
for
i
,
val
in
enumerate
(
eph
):
for
j
,
chn
in
enumerate
(
_channels
):
...
...
@@ -336,7 +329,7 @@ def plot_events_per_hour(infodict, out_path, out_name, formats):
ephmin
=
np
.
min
(
eph
)
ephmax
=
np
.
max
(
eph
)
logbins
=
np
.
geomspace
(
ephmin
,
ephmax
,
100
)
CPUtime
=
np
.
sum
(
times
)
/
(
1
if
unit
==
'
hours
'
else
60
)
CPUtime
=
np
.
sum
(
times
)
# create figure
fig
=
plt
.
figure
(
figsize
=
(
16
,
12
))
...
...
@@ -344,11 +337,9 @@ def plot_events_per_hour(infodict, out_path, out_name, formats):
# plot (multistack-)histogram
evrs
=
[]
lastch
=
'
LO
'
for
chn
in
_channels
:
if
chn
in
unique_channels
:
evrs
.
append
(
ephchn
[
masks
[
_channel_number
[
chn
]]][:,
0
])
lastch
=
chn
if
len
(
unique_channels
)
==
1
:
# plot each unique number in different color
...
...
@@ -362,9 +353,10 @@ def plot_events_per_hour(infodict, out_path, out_name, formats):
else
:
chnlab
=
[]
chncol
=
[]
for
chn
in
unique_channels
:
chnlab
.
append
(
chn
)
chncol
.
append
(
_channel_colors
[
_channel_number
[
chn
]])
for
chn
in
_channels
:
if
chn
in
unique_channels
:
chnlab
.
append
(
chn
)
chncol
.
append
(
_channel_colors
[
_channel_number
[
chn
]])
n
,
batches
,
_
=
ax
.
hist
(
evrs
,
histtype
=
'
barstacked
'
,
log
=
True
,
stacked
=
True
,
bins
=
logbins
,
edgecolor
=
'
black
'
,
color
=
chncol
,
label
=
chnlab
)
ax
.
set_xlim
(
0.9
*
ephmin
,
1.1
*
ephmax
)
ax
.
set_xscale
(
'
log
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment