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
4053ed56
Commit
4053ed56
authored
7 years ago
by
Christoph.Knote
Browse files
Options
Downloads
Patches
Plain Diff
Namelist sheet
parent
24dd7e4d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
boxmox/experiment.py
+9
-9
9 additions, 9 deletions
boxmox/experiment.py
with
9 additions
and
9 deletions
boxmox/experiment.py
+
9
−
9
View file @
4053ed56
...
...
@@ -50,34 +50,34 @@ class Namelist:
'''
def
__getitem__
(
self
,
item
):
if
item
.
lower
()
in
self
.
_
_
namelist
[
'
boxmox
'
].
keys
():
return
self
.
_
_
namelist
[
'
boxmox
'
][
item
.
lower
()]
if
item
.
lower
()
in
self
.
_namelist
[
'
boxmox
'
].
keys
():
return
self
.
_namelist
[
'
boxmox
'
][
item
.
lower
()]
else
:
raise
Exception
(
'
{:s} does not exist in Namelist.
'
.
format
(
item
))
def
__setitem__
(
self
,
item
,
value
):
if
item
.
lower
()
in
self
.
_
_
namelist
[
'
boxmox
'
].
keys
():
if
item
.
lower
()
in
self
.
_namelist
[
'
boxmox
'
].
keys
():
try
:
self
.
_
_
namelist
[
'
boxmox
'
][
item
]
=
value
self
.
_namelist
[
'
boxmox
'
][
item
]
=
value
except
:
raise
Exception
(
'
Failed to set {:s} to {:s}
'
.
format
(
item
,
str
(
value
)))
else
:
raise
Exception
(
'
{:s} does not exist in Namelist
'
.
format
(
item
))
def
__str__
(
self
):
return
'
,
'
.
join
(
[
(
'
{:s}: {:s}
'
.
format
(
item
,
str
(
self
.
_
_
namelist
[
'
boxmox
'
][
item
])))
for
item
in
self
.
_
_
namelist
[
'
boxmox
'
].
keys
()
]
)
return
'
,
'
.
join
(
[
(
'
{:s}: {:s}
'
.
format
(
item
,
str
(
self
.
_namelist
[
'
boxmox
'
][
item
])))
for
item
in
self
.
_namelist
[
'
boxmox
'
].
keys
()
]
)
def
keys
(
self
):
return
self
.
_
_
namelist
[
'
boxmox
'
].
keys
()
return
self
.
_namelist
[
'
boxmox
'
].
keys
()
def
write
(
self
,
path
):
'''
Write namelist to file.
'''
self
.
_
_
namelist
.
write
(
path
,
'
w
'
)
self
.
_namelist
.
write
(
path
,
'
w
'
)
def
read
(
self
,
path
):
'''
Read namelist from file.
'''
self
.
_
_
namelist
=
f90nml
.
read
(
path
)
self
.
_namelist
=
f90nml
.
read
(
path
)
def
__init__
(
self
,
path
=
None
):
self
.
_
_
namelist
=
None
self
.
_namelist
=
None
firstExample
=
examples
[
examples
.
keys
()[
0
]]
self
.
read
(
os
.
path
.
join
(
firstExample
.
path
,
"
BOXMOX.nml
"
))
...
...
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