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
320d915c
Commit
320d915c
authored
1 year ago
by
Alexandros Asonitis
Browse files
Options
Downloads
Patches
Plain Diff
added keystroke(esc) for stopping endurance test during the for loop execution !
parent
2368e4e5
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
hp4155/memristor/memristor.py
+22
-1
22 additions, 1 deletion
hp4155/memristor/memristor.py
hp4155/memristor/memristor_buttons.ipynb
+5
-5
5 additions, 5 deletions
hp4155/memristor/memristor_buttons.ipynb
with
27 additions
and
6 deletions
hp4155/memristor/memristor.py
+
22
−
1
View file @
320d915c
### this is the new memrstor measurement (set and reset as many times as the user wants and full sweeps with a button)
### this is the new memrstor measurement (set and reset as many times as the user wants and full sweeps with a button)
from
help
import
*
from
help
import
*
import
ipywidgets
as
widgets
import
ipywidgets
as
widgets
from
keyboard
import
add_hotkey
,
remove_hotkey
def
memristor
():
def
memristor
():
#parameters set by the user
#parameters set by the user
...
@@ -260,6 +261,13 @@ def memristor():
...
@@ -260,6 +261,13 @@ def memristor():
ax2
.
set
(
xlabel
=
'
Voltage(V)
'
,
ylabel
=
'
Current(A)
'
)
ax2
.
set
(
xlabel
=
'
Voltage(V)
'
,
ylabel
=
'
Current(A)
'
)
ax2
.
set_yscale
(
'
log
'
)
ax2
.
set_yscale
(
'
log
'
)
stop
=
False
def
break_loop
():
nonlocal
stop
stop
=
True
add_hotkey
(
"
esc
"
,
break_loop
)
#execute number of measurements
#execute number of measurements
for
i
in
range
(
number
.
value
):
for
i
in
range
(
number
.
value
):
V12
,
I12
=
sweep
(
0
,
Vset
,
step
,
CC_vset
,
integration_time
,
device
)
#set
V12
,
I12
=
sweep
(
0
,
Vset
,
step
,
CC_vset
,
integration_time
,
device
)
#set
...
@@ -286,6 +294,19 @@ def memristor():
...
@@ -286,6 +294,19 @@ def memristor():
print
(
df
)
print
(
df
)
display
(
fig
)
display
(
fig
)
#check for loop termination
if
stop
==
True
:
print
(
"
endurance stopped after esc!
"
)
f
.
write
(
"
endurance stopped!
\n\n
"
)
break
else
:
print
(
"
endurance completed!
"
)
f
.
write
(
"
endurance completed!
\n\n
"
)
remove_hotkey
(
'
esc
'
)
stop
=
False
set
.
disabled
=
False
set
.
disabled
=
False
reset
.
disabled
=
False
reset
.
disabled
=
False
full
.
disabled
=
False
full
.
disabled
=
False
...
...
This diff is collapsed.
Click to expand it.
hp4155/memristor/memristor_buttons.ipynb
+
5
−
5
View file @
320d915c
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
df708526c73e4219b9ebb5c74a3fd271
",
"model_id": "
c14f1c65cb75400e9f3ce8c3703d7a99
",
"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": "
5ed7f3d1a4ed451aabbca2bf236be413
",
"model_id": "
12bcdd599fbb404ba1d55569550ca2ce
",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4d
bb84e87dc84830904fb1fc6425e999
",
"model_id": "4d
15574dd8a8446cbb853b71056069d6
",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
978ed501be0748c0a55b80458b0653b1
",
"model_id": "
79f012dfd31d4ed4ae00b100d7a48586
",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
10de600753a941f493dee0709e56ea79
",
"model_id": "
9d266524e5f14609b48f0e698acf2476
",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
...
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