Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
finesse
pykat
Commits
3149d10a
Commit
3149d10a
authored
May 07, 2015
by
Daniel Brown
Browse files
more py3 bug fixes
parent
3e1718f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
pykat/finesse.py
View file @
3149d10a
...
...
@@ -1186,14 +1186,18 @@ class kat(object):
[
out
,
errpipe
]
=
p
.
communicate
()
_out
=
str
(
out
).
split
(
"
\n
"
)
if
six
.
PY2
:
_out
=
str
(
out
).
split
(
"
\n
"
)
else
:
_out
=
str
(
out
).
split
(
"
\\
n"
)
for
line
in
_out
[::
-
1
]:
if
line
.
lstrip
().
startswith
(
'computation time:'
):
try
:
r
.
runtime
=
float
(
line
.
split
(
":"
)[
1
].
replace
(
"s"
,
""
))
except
:
r
.
runtime
=
0.0
if
printout
==
1
:
print
(
out
)
else
:
...
...
@@ -1317,6 +1321,9 @@ class kat(object):
rtn
=
[
r
]
if
sys
.
version
>
'3'
:
long
=
int
if
self
.
__time_code
:
perffile
=
open
(
root
[
0
]
+
".perf"
,
'r'
)
...
...
pykat/optics/maps.py
View file @
3149d10a
...
...
@@ -577,7 +577,7 @@ def read_map(filename):
f
.
readline
()
name
=
f
.
readline
().
split
(
':'
)[
1
].
strip
()
maptype
=
f
.
readline
().
split
(
':'
)[
1
].
strip
()
size
=
tuple
(
map
(
lambda
x
:
in
t
(
x
),
f
.
readline
().
split
(
':'
)[
1
].
strip
().
split
()))
size
=
tuple
(
map
(
lambda
x
:
floa
t
(
x
),
f
.
readline
().
split
(
':'
)[
1
].
strip
().
split
()))
center
=
tuple
(
map
(
lambda
x
:
float
(
x
),
f
.
readline
().
split
(
':'
)[
1
].
strip
().
split
()))
step
=
tuple
(
map
(
lambda
x
:
float
(
x
),
f
.
readline
().
split
(
':'
)[
1
].
strip
().
split
()))
scaling
=
float
(
f
.
readline
().
split
(
':'
)[
1
].
strip
())
...
...
pykat/optics/romhom.py
View file @
3149d10a
...
...
@@ -686,7 +686,7 @@ def MakeROMFromHDF5(hdf5Filename, greedyFilename=None, EIFilename=None, tol=1e-1
Names
=
range
(
NProcesses
)
procs
=
[
Process
(
name
=
"process_%i"
%
l
[
0
],
target
=
_worker_ROM
,
args
=
(
hdf5Filename
,
queue
,
l
[
1
],
l
[
2
],
l
[
3
]))
for
l
in
itertools
.
i
zip
(
Names
,
result_err
,
result_idx
,
locks
)]
args
=
(
hdf5Filename
,
queue
,
l
[
1
],
l
[
2
],
l
[
3
]))
for
l
in
zip
(
Names
,
result_err
,
result_idx
,
locks
)]
max_res
=
np
.
zeros
((
NProcesses
),
dtype
=
'd'
)
max_idx
=
np
.
zeros
((
NProcesses
),
dtype
=
'i'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment