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
Sebastian Steinlechner
pykat
Commits
c7194e77
Commit
c7194e77
authored
11 years ago
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
change order of blocks when generating script. First come
all the read FTblocks, followed by the NO_BLOCK bits.
parent
2c40a2e4
No related branches found
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
+30
-16
30 additions, 16 deletions
pykat/finesse.py
with
30 additions
and
16 deletions
pykat/finesse.py
+
30
−
16
View file @
c7194e77
...
...
@@ -806,21 +806,11 @@ class kat(object):
print
"
** removing line
'
{0}
'"
.
format
(
obj
)
objs
.
remove
(
obj
)
def
generateKatScript
(
self
)
:
"""
Generates the kat file which can then be run
"""
out
=
[]
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
out
.
append
(
"
\n
"
)
if
key
!=
NO_BLOCK
and
np
.
size
(
objs
)
>
0
:
out
.
append
(
"
%%% FTblock
"
+
key
+
"
\n
"
)
def
writeBlock
():
for
obj
in
objs
:
if
isinstance
(
obj
,
str
):
out
.
append
(
obj
+
'
\n
'
)
...
...
@@ -835,9 +825,33 @@ class kat(object):
else
:
out
.
append
(
txt
+
"
\n
"
)
if
key
!=
NO_BLOCK
and
np
.
size
(
objs
)
>
0
:
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
np
.
size
(
objs
)
>
0
:
out
.
append
(
"
\n
"
)
out
.
append
(
"
%%% FTblock
"
+
key
+
"
\n
"
)
writeBlock
()
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
for
key
in
self
.
nodes
.
getNodes
():
txt
=
self
.
nodes
.
getNodes
()[
key
].
getFinesseText
()
...
...
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