Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
6c5bdd40
Commit
6c5bdd40
authored
10 years ago
by
Ger van Diepen
Browse files
Options
Downloads
Patches
Plain Diff
Task #7427 Create parset from dict
parent
130ee4f0
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
LCS/pyparameterset/src/__init__.py
+9
-1
9 additions, 1 deletion
LCS/pyparameterset/src/__init__.py
with
9 additions
and
1 deletion
LCS/pyparameterset/src/__init__.py
+
9
−
1
View file @
6c5bdd40
...
...
@@ -22,7 +22,6 @@
from
_pyparameterset
import
PyParameterValue
from
_pyparameterset
import
PyParameterSet
class
parametervalue
(
PyParameterValue
):
"""
The Python interface to ParameterValue
...
...
@@ -73,6 +72,7 @@ class parameterset(PyParameterSet):
filename
If a filename is given, the object is filled from that parset file.
If a bool is given, it is treated as argument caseInsensitive.
If a dict is given, it is a set of parameter values.
caseInsensitive
True = parameter names are case insensitive
...
...
@@ -85,6 +85,10 @@ class parameterset(PyParameterSet):
elif
isinstance
(
filename
,
bool
):
# Here filename argument means caseInsensitive
PyParameterSet
.
__init__
(
self
,
filename
,
0
,
0
);
elif
isinstance
(
filename
,
dict
):
# Here filename argument means caseInsensitive
PyParameterSet
.
__init__
(
self
,
caseInsensitive
,
0
,
0
);
self
.
adoptDict
(
filename
)
else
:
PyParameterSet
.
__init__
(
self
,
filename
,
caseInsensitive
);
...
...
@@ -143,6 +147,10 @@ class parameterset(PyParameterSet):
if
len
(
kv
)
==
2
:
self
.
replace
(
kv
[
0
],
kv
[
1
])
def
adoptDict
(
self
,
parms
):
for
(
k
,
v
)
in
parms
.
iteritems
():
self
.
replace
(
k
,
v
)
def
get
(
self
,
key
):
"""
Get the parametervalue object of a parameter.
"""
return
parametervalue
(
self
.
_get
(
key
),
_copyObj
=
True
)
...
...
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