Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
BOXMOX Python Package
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
MBEES
BOXMOX Python Package
Commits
4b7a46b6
Commit
4b7a46b6
authored
7 years ago
by
Christoph.Knote
Browse files
Options
Downloads
Patches
Plain Diff
OK, it won't work, probably, but it's a first try.
parent
999b34e5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
boxmox/experiment.py
+13
-4
13 additions, 4 deletions
boxmox/experiment.py
with
13 additions
and
4 deletions
boxmox/experiment.py
+
13
−
4
View file @
4b7a46b6
...
@@ -112,6 +112,8 @@ class Experiment:
...
@@ -112,6 +112,8 @@ class Experiment:
#: Log file of the last run
#: Log file of the last run
self
.
lastLog
=
None
self
.
lastLog
=
None
self
.
pid
=
None
self
.
__new
()
self
.
__new
()
#: Namelist
#: Namelist
...
@@ -184,11 +186,12 @@ class Experiment:
...
@@ -184,11 +186,12 @@ class Experiment:
return
mech
return
mech
def
run
(
self
,
dumbOutput
=
False
):
def
run
(
self
,
dumbOutput
=
False
,
asynchronous
=
False
):
'''
'''
Run BOXMOX experiment
Run BOXMOX experiment
:param bool dumbOutput: Only load references to output files, instead of loading data? (faster, but not usable for analysis)
:param bool dumbOutput: Only load references to output files, instead of loading data? (faster, but not usable for analysis)
:param bool asynchronous: Run asynchronous?
'''
'''
self
.
namelist
.
write
(
os
.
path
.
join
(
self
.
path
,
'
BOXMOX.nml
'
))
self
.
namelist
.
write
(
os
.
path
.
join
(
self
.
path
,
'
BOXMOX.nml
'
))
...
@@ -200,11 +203,13 @@ class Experiment:
...
@@ -200,11 +203,13 @@ class Experiment:
os
.
chdir
(
self
.
path
)
os
.
chdir
(
self
.
path
)
try
:
try
:
p
=
s
.
Popen
(
"
./
"
+
self
.
mechanism
+
"
.exe
"
,
stdout
=
s
.
PIPE
,
bufsize
=
1
)
self
.
pid
=
s
.
Popen
(
"
./
"
+
self
.
mechanism
+
"
.exe
"
,
stdout
=
s
.
PIPE
,
bufsize
=
1
)
p
.
wait
()
# wait for the subprocess to exit
if
asynchronous
:
return
self
.
pid
.
wait
()
# wait for the subprocess to exit
self
.
lastLog
=
[]
self
.
lastLog
=
[]
for
line
in
iter
(
p
.
stdout
.
readline
,
b
''
):
for
line
in
iter
(
self
.
pid
.
stdout
.
readline
,
b
''
):
self
.
lastLog
.
append
(
line
.
replace
(
'
\n
'
,
''
))
self
.
lastLog
.
append
(
line
.
replace
(
'
\n
'
,
''
))
except
Exception
as
e
:
except
Exception
as
e
:
...
@@ -293,6 +298,8 @@ class ExperimentFromExample(Experiment):
...
@@ -293,6 +298,8 @@ class ExperimentFromExample(Experiment):
self
.
lastLog
=
None
self
.
lastLog
=
None
self
.
pid
=
None
self
.
input
=
{}
self
.
input
=
{}
self
.
output
=
{}
self
.
output
=
{}
...
@@ -333,6 +340,8 @@ class ExperimentFromExistingRun(Experiment):
...
@@ -333,6 +340,8 @@ class ExperimentFromExistingRun(Experiment):
self
.
lastLog
=
None
self
.
lastLog
=
None
self
.
pid
=
None
self
.
input
=
{}
self
.
input
=
{}
self
.
output
=
{}
self
.
output
=
{}
...
...
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