Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
labcode
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CST
labcode
Commits
2e005f1d
Commit
2e005f1d
authored
7 months ago
by
Alexandros Asonitis
Browse files
Options
Downloads
Patches
Plain Diff
Sentech Evaluation completed
parent
76db0f54
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sentech/evaluation.py
+48
-3
48 additions, 3 deletions
sentech/evaluation.py
sentech/interface_evaluation.ipynb
+20
-5
20 additions, 5 deletions
sentech/interface_evaluation.ipynb
with
68 additions
and
8 deletions
sentech/evaluation.py
+
48
−
3
View file @
2e005f1d
...
@@ -2,6 +2,7 @@ import ipywidgets as widgets
...
@@ -2,6 +2,7 @@ import ipywidgets as widgets
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
import
pandas
as
pd
import
pandas
as
pd
import
os
import
os
import
numpy
as
np
import
tkinter
as
tk
import
tkinter
as
tk
from
tkinter
import
filedialog
from
tkinter
import
filedialog
...
@@ -82,9 +83,11 @@ dir_button = widgets.Button(description = 'Choose Folder')
...
@@ -82,9 +83,11 @@ dir_button = widgets.Button(description = 'Choose Folder')
plot_button
=
widgets
.
Button
(
description
=
'
Plot
'
)
plot_button
=
widgets
.
Button
(
description
=
'
Plot
'
)
next_file
=
widgets
.
Button
(
description
=
'
Next File
'
)
next_file
=
widgets
.
Button
(
description
=
'
Next File
'
)
previous_file
=
widgets
.
Button
(
description
=
'
Previous file
'
)
previous_file
=
widgets
.
Button
(
description
=
'
Previous file
'
)
current_file
=
widgets
.
Text
(
description
=
'
Current File
'
,
disabled
=
True
)
current_file
=
widgets
.
Text
(
description
=
'
Current File
'
,
disabled
=
True
,
value
=
'
No File Selected
'
)
x_axis
=
widgets
.
Dropdown
(
description
=
'
X-Axis
'
,
disabled
=
True
)
x_axis
=
widgets
.
Dropdown
(
description
=
'
X-Axis
'
,
disabled
=
True
)
y_axis
=
widgets
.
Dropdown
(
description
=
'
Y-Axis
'
)
y_axis
=
widgets
.
Dropdown
(
description
=
'
Y-Axis
'
)
x_scale
=
widgets
.
Dropdown
(
description
=
'
X-Scale
'
,
options
=
[
'
linear
'
,
'
log
'
],
value
=
'
linear
'
)
y_scale
=
widgets
.
Dropdown
(
description
=
'
Y-Scale
'
,
options
=
[
'
linear
'
,
'
log
'
],
value
=
'
linear
'
)
output
=
widgets
.
Output
()
output
=
widgets
.
Output
()
counter
=
0
counter
=
0
...
@@ -96,16 +99,19 @@ device = None
...
@@ -96,16 +99,19 @@ device = None
buttons
=
widgets
.
HBox
([
dir_button
,
plot_button
,
previous_file
,
next_file
])
buttons
=
widgets
.
HBox
([
dir_button
,
plot_button
,
previous_file
,
next_file
])
config
=
widgets
.
HBox
([
x_axis
,
y_axis
,
current_file
])
config
=
widgets
.
HBox
([
x_axis
,
y_axis
,
current_file
])
scale
=
widgets
.
HBox
([
x_scale
,
y_scale
])
display
(
buttons
)
display
(
buttons
)
display
(
config
)
display
(
config
)
display
(
scale
)
display
(
output
)
display
(
output
)
all_widgets
=
[
dir_button
,
plot_button
,
previous_file
,
next_file
,
y_axis
]
all_widgets
=
[
dir_button
,
plot_button
,
previous_file
,
next_file
,
y_axis
,
x_scale
,
y_scale
]
def
on_choose_folder_clicked
(
b
):
def
on_choose_folder_clicked
(
b
):
global
counter
,
folder
,
files
,
df
,
start_time
,
device
global
counter
,
folder
,
files
,
df
,
start_time
,
device
with
output
:
with
output
:
change_state
(
all_widgets
)
change_state
(
all_widgets
)
current_file
.
value
=
'
No File Selected
'
folder
=
choose_folder
()
folder
=
choose_folder
()
os
.
chdir
(
folder
)
#change current working directory
os
.
chdir
(
folder
)
#change current working directory
files
=
os
.
listdir
(
os
.
getcwd
())
#get the files from the chosen directory
files
=
os
.
listdir
(
os
.
getcwd
())
#get the files from the chosen directory
...
@@ -173,6 +179,45 @@ def on_next_file_clicked(b):
...
@@ -173,6 +179,45 @@ def on_next_file_clicked(b):
next_file
.
on_click
(
on_next_file_clicked
)
next_file
.
on_click
(
on_next_file_clicked
)
def
on_plot_clicked
(
b
):
global
counter
,
folder
,
files
,
df
,
start_time
,
device
with
output
:
change_state
(
all_widgets
)
if
current_file
.
value
!=
'
No File Selected
'
:
#there is a file to plot
fig
,
ax
=
plt
.
subplots
()
fig
.
suptitle
(
device
+
"
"
+
start_time
)
if
x_scale
.
value
==
'
log
'
:
x
=
np
.
absolute
(
df
[
x_axis
.
value
])
ax
.
set_xscale
(
'
log
'
)
else
:
x
=
df
[
x_axis
.
value
]
ax
.
set_xscale
(
'
linear
'
)
if
y_scale
.
value
==
'
log
'
:
y
=
np
.
absolute
(
df
[
y_axis
.
value
])
ax
.
set_yscale
(
'
log
'
)
else
:
y
=
df
[
y_axis
.
value
]
ax
.
set_yscale
(
'
linear
'
)
ax
.
set_xlabel
(
x_axis
.
value
)
ax
.
set_ylabel
(
y_axis
.
value
)
ax
.
plot
(
x
,
y
,
color
=
'
b
'
)
mng
=
plt
.
get_current_fig_manager
()
mng
.
window
.
state
(
'
zoomed
'
)
mng
.
window
.
attributes
(
'
-topmost
'
,
1
)
plt
.
show
(
block
=
True
)
else
:
information_box
(
"
No file to plot!
"
)
change_state
(
all_widgets
)
plot_button
.
on_click
(
on_plot_clicked
)
...
...
This diff is collapsed.
Click to expand it.
sentech/interface_evaluation.ipynb
+
20
−
5
View file @
2e005f1d
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
10b418b71d7240bb9a7b4847970f573
2",
"model_id": "
31e5cb6d8eff449a9135e0c48265e01
2",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
67de78df200741548f24348ae8d5e349
",
"model_id": "
8548005931624344acaf30e06d1c041c
",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -37,7 +37,21 @@
...
@@ -37,7 +37,21 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e1dd9aefebfe4462b1cbc4b931c652d9",
"model_id": "d5fe062acf8b460da0c1a6e4464359e1",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(Dropdown(description='X-Scale', options=('linear', 'log'), value='linear'), Dropdown(descriptio…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "cf6a0450d737405da18a17adeaf888bb",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -50,13 +64,14 @@
...
@@ -50,13 +64,14 @@
}
}
],
],
"source": [
"source": [
"%matplotlib tk\n",
"%run evaluation.py"
"%run evaluation.py"
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": null,
"execution_count": null,
"id": "
3773b35c-de0e-4515-b1a2-ed0e92d63c6e
",
"id": "
150e0b0a-18c8-4e4e-b3cc-41ba2c1a66ad
",
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": []
"source": []
...
@@ -64,7 +79,7 @@
...
@@ -64,7 +79,7 @@
],
],
"metadata": {
"metadata": {
"kernelspec": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3
(ipykernel)
",
"language": "python",
"language": "python",
"name": "python3"
"name": "python3"
},
},
...
...
%% Cell type:code id:e615178f-e424-4ae7-a128-5428c9b562d7 tags:
%% Cell type:code id:e615178f-e424-4ae7-a128-5428c9b562d7 tags:
```
python
```
python
%
matplotlib
tk
%
run
evaluation
.
py
%
run
evaluation
.
py
```
```
%% Output
%% Output
%% Cell type:code id:3773b35c-de0e-4515-b1a2-ed0e92d63c6e tags:
%% Cell type:code id:150e0b0a-18c8-4e4e-b3cc-41ba2c1a66ad tags:
```
python
```
python
```
```
...
...
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