Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Tobias Langer
/
experiment
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ad3f235b
authored
Nov 14, 2016
by
Tobias Langer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore unimportant errors and move remove errornous files.
parent
45b8c468
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
runner.py
+11
-5
No files found.
runner.py
View file @
ad3f235b
...
@@ -36,10 +36,7 @@ def create_dir(filename):
...
@@ -36,10 +36,7 @@ def create_dir(filename):
try
:
try
:
os
.
makedirs
(
filename
)
os
.
makedirs
(
filename
)
except
FileExistsError
:
except
FileExistsError
:
if
not
query_yes_no
(
'Folder exists, remove?'
,
default
=
'yes'
):
pass
return
False
shutil
.
rmtree
(
filename
)
os
.
makedirs
(
filename
)
return
True
return
True
class
cd
:
class
cd
:
...
@@ -73,8 +70,13 @@ def main():
...
@@ -73,8 +70,13 @@ def main():
for
experiment
in
os
.
listdir
():
for
experiment
in
os
.
listdir
():
if
experiment
==
'results'
or
not
os
.
path
.
isdir
(
experiment
):
if
experiment
==
'results'
or
not
os
.
path
.
isdir
(
experiment
):
continue
continue
if
experiment
.
isdigit
():
continue
experiment_file
=
os
.
path
.
join
(
'results'
,
experiment
+
'.out'
)
if
os
.
path
.
exists
(
experiment_file
):
continue
with
open
(
os
.
path
.
join
(
'results'
,
experiment
+
'.out'
)
,
'w'
)
as
of
:
with
open
(
experiment_file
,
'w'
)
as
of
:
with
cd
(
experiment
):
with
cd
(
experiment
):
try
:
try
:
p
=
Popen
([
'./'
+
experiment
],
stdout
=
of
)
p
=
Popen
([
'./'
+
experiment
],
stdout
=
of
)
...
@@ -84,6 +86,10 @@ def main():
...
@@ -84,6 +86,10 @@ def main():
print
(
'Failed running experiment: {}'
.
format
(
experiment
),
print
(
'Failed running experiment: {}'
.
format
(
experiment
),
file
=
sys
.
stderr
)
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
if
os
.
stat
(
experiment_file
)
.
st_size
==
0
:
print
(
'Removing file after failed experiment.'
,
file
=
sys
.
stderr
)
os
.
remove
(
experiment_file
)
shutil
.
rmtree
(
experiment
)
# with cd(experiment):
# with cd(experiment):
...
...
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