Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pykat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
finesse
pykat
Commits
0188cda1
Commit
0188cda1
authored
12 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
adding test scripts
parent
af1789aa
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
scripts/test_property.py
+36
-0
36 additions, 0 deletions
scripts/test_property.py
scripts/test_pykat_gui.py
+62
-0
62 additions, 0 deletions
scripts/test_pykat_gui.py
with
98 additions
and
0 deletions
scripts/test_property.py
0 → 100644
+
36
−
0
View file @
0188cda1
class
Param
(
float
):
def
__new__
(
self
,
name
,
value
):
return
float
.
__new__
(
self
,
value
)
def
__init__
(
self
,
name
,
value
):
self
.
__name
=
name
name
=
property
(
lambda
self
:
self
.
__name
)
class
Beer
(
object
):
def
__init__
(
self
,
temp
):
self
.
__T
=
temp
@property
def
temp
(
self
):
return
Param
(
'
Beer Temperature
'
,
self
.
__T
)
@temp.setter
def
temp
(
self
,
value
):
self
.
__T
=
float
(
value
)
b
=
Beer
(
100
)
print
b
.
temp
.
name
,
b
.
temp
.
__class__
print
b
.
temp
*
4.5
print
b
.
temp
.
name
,
b
.
temp
.
__class__
b
.
temp
=
101
print
b
.
temp
.
name
,
b
.
temp
.
__class__
print
b
.
temp
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts/test_pykat_gui.py
0 → 100644
+
62
−
0
View file @
0188cda1
import
sys
sys
.
path
.
append
(
"
../
"
)
from
pykat
import
finesse
from
pykat.detectors
import
*
from
pykat.components
import
*
from
pykat.commands
import
*
from
pykat.structs
import
*
#from pykat.plotting import *
import
numpy
as
np
import
pylab
as
pl
kat
=
finesse
.
kat
()
laser
(
kat
,
'
l1
'
,
'
n1
'
,
1
)
space
(
kat
,
'
s1
'
,
'
n1
'
,
'
n2
'
,
1
)
mirror
(
kat
,
'
m1
'
,
'
n2
'
,
'
n3
'
,
R
=
0.8
,
T
=
0.2
)
space
(
kat
,
'
s2
'
,
'
n3
'
,
'
n4
'
,
L
=
1
)
mirror
(
kat
,
'
m2
'
,
'
n4
'
,
'
n5
'
,
R
=
0.7
,
T
=
0.3
)
cavity
(
kat
,
'
cav1
'
,
'
m1
'
,
'
n3
'
,
'
m2
'
,
'
n4
'
)
space
(
kat
,
'
s3
'
,
'
n5
'
,
'
n6
'
,
L
=
1
)
photodiode
(
kat
,
'
pd_cav
'
,
'
n4
'
)
photodiode
(
kat
,
'
pd_ref
'
,
'
n2
'
)
photodiode
(
kat
,
'
pd_trs
'
,
'
n5
'
)
kat
.
m1
.
Rcx
=
-
1000.0
kat
.
m1
.
Rcy
=
-
1000.0
kat
.
m2
.
Rcx
=
1000.0
kat
.
m2
.
Rcy
=
1000.0
xaxis
(
kat
,
Scale
.
linear
,
[
0
,
360
],
kat
.
m2
,
kat
.
m2
.
phi
,
1000
)
kat
.
maxtem
=
0
run
=
kat
.
run
(
printout
=
0
,
printerr
=
0
)
#pl.figure()
#pl.ion()
#pl.plot(run.x,run.y)
#pl.xlabel(run.xlabel)
#pl.ylabel("Intensity [W]")
#pl.legend(run.ylabels)
#pl.show()
kat
.
m1
.
R
=
0.5
kat
.
m1
.
T
=
0.5
kat
.
pd_cav
.
enabled
=
False
run
=
kat
.
run
(
printout
=
0
,
printerr
=
0
)
#pl.figure()
#pl.plot(run.x,run.y)
#pl.xlabel(run.xlabel)
#pl.ylabel("Intensity [W]")
#pl.legend(run.ylabels)
#pl.show()
kat
.
openGUI
()
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