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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Steinlechner
pykat
Commits
183a2756
Commit
183a2756
authored
Feb 25, 2014
by
Daniel Brown
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitmaster.atlas.aei.uni-hannover.de:pykat/pykat
Conflicts: pykat/finesse.py
parents
8e51b3ba
c7194e77
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pykat/finesse.py
+34
-21
34 additions, 21 deletions
pykat/finesse.py
with
34 additions
and
21 deletions
pykat/finesse.py
+
34
−
21
View file @
183a2756
...
@@ -33,9 +33,8 @@ import pickle
...
@@ -33,9 +33,8 @@ import pickle
import
pykat
import
pykat
import
warnings
import
warnings
import
re
import
re
import
collections
from
collections
import
namedtuple
from
collections
import
namedtuple
,
OrderedDict
from
pykat.node_network
import
NodeNetwork
from
pykat.node_network
import
NodeNetwork
from
pykat.detectors
import
Detector
from
pykat.detectors
import
Detector
...
@@ -245,7 +244,7 @@ class kat(object):
...
@@ -245,7 +244,7 @@ class kat(object):
self
.
scene
=
None
# scene object for GUI
self
.
scene
=
None
# scene object for GUI
self
.
verbose
=
True
self
.
verbose
=
True
self
.
__blocks
=
{}
# dictionary of blocks that are used
self
.
__blocks
=
OrderedDict
()
# dictionary of blocks that are used
self
.
__components
=
{}
# dictionary of optical components
self
.
__components
=
{}
# dictionary of optical components
self
.
__detectors
=
{}
# dictionary of detectors
self
.
__detectors
=
{}
# dictionary of detectors
self
.
__commands
=
{}
# dictionary of commands
self
.
__commands
=
{}
# dictionary of commands
...
@@ -394,7 +393,7 @@ class kat(object):
...
@@ -394,7 +393,7 @@ class kat(object):
if
values
[
1
]
==
"
FTblock
"
:
if
values
[
1
]
==
"
FTblock
"
:
newTag
=
values
[
2
]
newTag
=
values
[
2
]
if
self
.
__currentTag
!=
None
and
newTag
!=
self
.
__currentTag
:
if
self
.
__currentTag
!=
None
and
self
.
__currentTag
!=
NO_BLOCK
:
warnings
.
warn
(
"
found block {0} before block {1} ended
"
.
format
(
newTag
,
self
.
__currentTag
))
warnings
.
warn
(
"
found block {0} before block {1} ended
"
.
format
(
newTag
,
self
.
__currentTag
))
if
newTag
in
self
.
__blocks
:
if
newTag
in
self
.
__blocks
:
...
@@ -806,20 +805,11 @@ class kat(object):
...
@@ -806,20 +805,11 @@ class kat(object):
print
"
** removing line
'
{0}
'"
.
format
(
obj
)
print
"
** removing line
'
{0}
'"
.
format
(
obj
)
objs
.
remove
(
obj
)
objs
.
remove
(
obj
)
def
generateKatScript
(
self
)
:
def
generateKatScript
(
self
)
:
"""
Generates the kat file which can then be run
"""
"""
Generates the kat file which can then be run
"""
out
=
[]
def
writeBlock
():
import
datetime
strtoday
=
datetime
.
datetime
.
now
()
out
.
append
(
strtoday
.
strftime
(
"
%% Generated by PyKat %d.%m.%Y %H:%M:%S
\n
"
)
)
for
key
in
self
.
__blocks
:
objs
=
self
.
__blocks
[
key
].
contents
if
key
!=
NO_BLOCK
:
out
.
append
(
"
%%% FTblock
"
+
key
+
"
\n
"
)
for
obj
in
objs
:
for
obj
in
objs
:
if
isinstance
(
obj
,
str
):
if
isinstance
(
obj
,
str
):
out
.
append
(
obj
+
'
\n
'
)
out
.
append
(
obj
+
'
\n
'
)
...
@@ -834,9 +824,33 @@ class kat(object):
...
@@ -834,9 +824,33 @@ class kat(object):
else
:
else
:
out
.
append
(
txt
+
"
\n
"
)
out
.
append
(
txt
+
"
\n
"
)
out
=
[]
import
datetime
strtoday
=
datetime
.
datetime
.
now
()
out
.
append
(
strtoday
.
strftime
(
"
%% Generated by PyKat %d.%m.%Y %H:%M:%S
\n
"
)
)
# write the FTblocks
for
key
in
self
.
__blocks
:
objs
=
self
.
__blocks
[
key
].
contents
if
key
!=
NO_BLOCK
:
if
key
!=
NO_BLOCK
:
if
np
.
size
(
objs
)
>
0
:
out
.
append
(
"
\n
"
)
out
.
append
(
"
%%% FTblock
"
+
key
+
"
\n
"
)
writeBlock
()
out
.
append
(
"
%%% FTend
"
+
key
+
"
\n
"
)
out
.
append
(
"
%%% FTend
"
+
key
+
"
\n
"
)
# write the NO_BLOCK blocks
for
key
in
self
.
__blocks
:
objs
=
self
.
__blocks
[
key
].
contents
if
key
==
NO_BLOCK
:
if
np
.
size
(
objs
)
>
0
:
out
.
append
(
"
\n
"
)
writeBlock
()
# now loop through all the nodes and get any gauss commands
# now loop through all the nodes and get any gauss commands
for
key
in
self
.
nodes
.
getNodes
():
for
key
in
self
.
nodes
.
getNodes
():
txt
=
self
.
nodes
.
getNodes
()[
key
].
getFinesseText
()
txt
=
self
.
nodes
.
getNodes
()[
key
].
getFinesseText
()
...
@@ -857,7 +871,6 @@ class kat(object):
...
@@ -857,7 +871,6 @@ class kat(object):
else
:
else
:
out
.
append
(
txt
+
"
\n
"
)
out
.
append
(
txt
+
"
\n
"
)
if
self
.
vacuum
!=
None
:
if
self
.
vacuum
!=
None
:
if
isinstance
(
self
.
vacuum
,
collections
.
Container
):
if
isinstance
(
self
.
vacuum
,
collections
.
Container
):
...
...
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