Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DetectorWriteSim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
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
EWMSCP
DetectorWriteSim
Commits
6eb4fede
Commit
6eb4fede
authored
1 year ago
by
Michael Reuscher
Browse files
Options
Downloads
Patches
Plain Diff
New save for Plots update
parent
fe9e532c
No related branches found
No related tags found
1 merge request
!4
Python driver and data analysis part
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
simrunner/simrunner.py
+2
-2
2 additions, 2 deletions
simrunner/simrunner.py
visualizer/visualizer/SeabornPlotter.py
+9
-4
9 additions, 4 deletions
visualizer/visualizer/SeabornPlotter.py
visualizer/visualizer/main.py
+2
-1
2 additions, 1 deletion
visualizer/visualizer/main.py
with
13 additions
and
7 deletions
simrunner/simrunner.py
+
2
−
2
View file @
6eb4fede
...
...
@@ -127,8 +127,8 @@ args = parse_arguments()
# Setup all paths and folders
simulation_path
=
args
.
sim
data_path
=
os
.
path
.
join
(
args
.
data
,
"
output
1
"
)
protokoll_path
=
os
.
path
.
join
(
args
.
protokoll
,
"
protokoll
"
)
data_path
=
os
.
path
.
join
(
args
.
data
,
"
output
"
)
protokoll_path
=
os
.
path
.
join
(
args
.
protokoll
,
"
test_data
"
)
stat_path
=
os
.
path
.
join
(
data_path
,
"
statistics
"
)
os
.
makedirs
(
protokoll_path
,
mode
=
0o777
,
exist_ok
=
True
)
os
.
makedirs
(
stat_path
,
mode
=
0o777
,
exist_ok
=
True
)
...
...
This diff is collapsed.
Click to expand it.
visualizer/visualizer/SeabornPlotter.py
+
9
−
4
View file @
6eb4fede
...
...
@@ -42,7 +42,7 @@ class SeabornPlotter:
folder
=
self
.
_make_folder
(
'
Various_Events
'
)
x
=
df
[
'
size
'
]
y
=
df
[
'
duration
'
]
title
=
"
Procedure: {}
"
.
format
(
self
.
name
)
title
=
"
Various
Procedure: {}
"
.
format
(
self
.
name
)
bins_x
,
bins_y
=
self
.
_prepare_bins
(
df
)
f
,
ax
=
plt
.
subplots
(
figsize
=
(
16
,
9
))
sns
.
histplot
(
x
=
x
,
y
=
y
,
color
=
"
blue
"
,
bins
=
[
bins_x
,
bins_y
])
...
...
@@ -57,6 +57,7 @@ class SeabornPlotter:
plt
.
savefig
(
os
.
path
.
join
(
folder
,
f
"
{
title
}
.svg
"
))
plt
.
close
()
print
(
title
+
"
Plot done!
"
)
def
plot_histogram_long
(
self
):
df
=
self
.
dataframe
...
...
@@ -69,14 +70,16 @@ class SeabornPlotter:
sns
.
histplot
(
x
=
x
,
y
=
y
,
color
=
"
blue
"
)
self
.
_add_logo
(
"
desy_logo.png
"
,
logo_size
=
0.15
,
logo_x
=
1.065
,
logo_y
=
1.04
)
ax
.
set_xlabel
(
"
Data size [Bytes]
"
)
ax
.
set_xlabel
(
"
Seconds since start
"
)
ax
.
set_ylabel
(
"
Time/Event [s]
"
)
ax
.
set_yscale
(
'
log
'
)
plt
.
title
(
title
)
plt
.
grid
(
True
)
plt
.
xticks
(
rotation
=
45
)
plt
.
savefig
(
os
.
path
.
join
(
folder
,
f
"
{
title
}
.svg
"
))
plt
.
savefig
(
os
.
path
.
join
(
folder
,
f
'
{
title
}
.svg
'
))
plt
.
close
()
print
(
title
+
"
Plot done!
"
)
def
plot_statistics
(
self
):
dataframes
=
self
.
dataframe
...
...
@@ -84,6 +87,7 @@ class SeabornPlotter:
for
df_key
,
df
in
dataframes
.
items
():
operations
=
df
[
'
Group
'
].
unique
()
num_plots
=
len
(
operations
)
title
=
df_key
.
replace
(
"
.dat
"
,
""
)
rows
=
2
# Number of rows in the grid
cols
=
(
num_plots
+
1
)
//
rows
# Number of columns in the grid
fig
,
axes
=
plt
.
subplots
(
rows
,
cols
,
figsize
=
(
15
,
8
),
constrained_layout
=
True
)
...
...
@@ -103,6 +107,7 @@ class SeabornPlotter:
ax
.
grid
(
True
)
ax
.
set_ylim
(
bottom
=
global_min_speed
,
top
=
global_max_speed
)
# Set the Y-axis limits
plt
.
savefig
(
os
.
path
.
join
(
folder
,
f
"
{
df_key
}
.svg
"
))
plt
.
savefig
(
os
.
path
.
join
(
folder
,
f
"
{
title
}
.svg
"
))
plt
.
close
()
print
(
title
+
"
Plot done!
"
)
This diff is collapsed.
Click to expand it.
visualizer/visualizer/main.py
+
2
−
1
View file @
6eb4fede
...
...
@@ -24,7 +24,7 @@ def main():
s_plotter
=
SeabornPlotter
(
s_dataframes
,
'
statistics
'
,
statistics_path
)
s_plotter
.
plot_statistics
()
# Plot
Data
# Plot
Various
for
frame
in
v_dataframes
.
keys
():
if
not
v_dataframes
[
frame
].
empty
:
# Setup Plotter
...
...
@@ -33,6 +33,7 @@ def main():
# Plotter run
v_plotter
.
plot_histogram_various
()
# Plot Long
for
frame
in
l_dataframes
.
keys
():
if
not
v_dataframes
[
frame
].
empty
:
# Setup Plotter
...
...
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