Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Berk Onat
python-common
Commits
755b8a39
Commit
755b8a39
authored
8 years ago
by
Lauri Himanen
Browse files
Options
Downloads
Patches
Plain Diff
Added additional warning to LocalBackend about adding the same data multiple times to.
parent
1e6f1e44
Branches
Branches containing commit
Tags
1.1.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/python/nomadcore/local_backend.py
+11
-13
11 additions, 13 deletions
common/python/nomadcore/local_backend.py
with
11 additions
and
13 deletions
common/python/nomadcore/local_backend.py
+
11
−
13
View file @
755b8a39
...
@@ -202,11 +202,12 @@ class LocalBackend(object):
...
@@ -202,11 +202,12 @@ class LocalBackend(object):
"""
"""
pass
pass
def
addMatchTelemetry
(
self
,
match_telemetry
,
gIndex
=
-
1
):
def
addMatchTelemetry
(
self
,
match_telemetry
,
gIndex
=
-
1
):
"""
should be called for outputting match telemetry data:
"""
should be called for outputting match telemetry data:
input data, together with capture info
"""
input data, together with capture info
"""
pass
pass
#===============================================================================
#===============================================================================
class
Results
(
object
):
class
Results
(
object
):
"""
A wrapper object for the collection of results gathered by a parser.
"""
A wrapper object for the collection of results gathered by a parser.
...
@@ -241,12 +242,9 @@ class Results(object):
...
@@ -241,12 +242,9 @@ class Results(object):
open_sections
=
sectionmanager
.
openSections
open_sections
=
sectionmanager
.
openSections
result
=
[]
result
=
[]
for
section
in
open_sections
.
values
():
for
section
in
open_sections
.
values
():
data_list
=
section
[
metaname
]
data
=
section
[
metaname
]
if
data_list
is
not
None
:
if
data
is
not
None
:
if
len
(
data_list
)
==
1
:
result
.
append
(
data
)
result
.
append
(
data_list
[
0
])
else
:
result
.
append
(
data_list
)
if
len
(
result
)
==
1
:
if
len
(
result
)
==
1
:
return
result
[
0
]
return
result
[
0
]
elif
len
(
result
)
==
0
:
elif
len
(
result
)
==
0
:
...
@@ -349,10 +347,10 @@ class Section(object):
...
@@ -349,10 +347,10 @@ class Section(object):
there aren
'
t any. You can search values and subsections.
there aren
'
t any. You can search values and subsections.
"""
"""
res
=
self
.
simpleValues
.
get
(
metaName
,
None
)
res
=
self
.
simpleValues
.
get
(
metaName
,
None
)
if
res
:
if
res
is
not
None
:
return
res
return
res
res
=
self
.
arrayValues
.
get
(
metaName
,
None
)
res
=
self
.
arrayValues
.
get
(
metaName
,
None
)
if
res
:
if
res
is
not
None
:
return
res
return
res
res
=
self
.
subSectionValues
.
get
(
metaName
,
None
)
res
=
self
.
subSectionValues
.
get
(
metaName
,
None
)
return
res
return
res
...
@@ -361,9 +359,9 @@ class Section(object):
...
@@ -361,9 +359,9 @@ class Section(object):
if
self
.
backend
.
store
:
if
self
.
backend
.
store
:
vals
=
self
.
simpleValues
.
get
(
metaInfo
.
name
,
None
)
vals
=
self
.
simpleValues
.
get
(
metaInfo
.
name
,
None
)
if
vals
is
None
:
if
vals
is
None
:
self
.
simpleValues
[
metaInfo
.
name
]
=
[
value
]
self
.
simpleValues
[
metaInfo
.
name
]
=
value
else
:
else
:
vals
.
append
(
valu
e
)
raise
Exception
(
"
Trying to add values multiple times for metaname {} in section {}.
"
.
format
(
metaInfo
.
name
,
self
.
nam
e
)
)
def
setArrayValues
(
self
,
metaInfo
,
values
,
offset
=
None
):
def
setArrayValues
(
self
,
metaInfo
,
values
,
offset
=
None
):
if
self
.
backend
.
store
:
if
self
.
backend
.
store
:
...
@@ -381,9 +379,9 @@ class Section(object):
...
@@ -381,9 +379,9 @@ class Section(object):
if
self
.
backend
.
store
:
if
self
.
backend
.
store
:
vals
=
self
.
arrayValues
.
get
(
metaInfo
.
name
,
None
)
vals
=
self
.
arrayValues
.
get
(
metaInfo
.
name
,
None
)
if
vals
is
None
:
if
vals
is
None
:
self
.
arrayValues
[
metaInfo
.
name
]
=
[
values
]
self
.
arrayValues
[
metaInfo
.
name
]
=
values
else
:
else
:
vals
.
append
(
values
)
raise
Exception
(
"
Trying to add values multiple times for metaname {} in section {}.
"
.
format
(
metaInfo
.
name
,
self
.
name
)
)
def
addSubsection
(
self
,
metaInfo
,
section
):
def
addSubsection
(
self
,
metaInfo
,
section
):
vals
=
self
.
subSectionValues
.
get
(
metaInfo
.
name
,
None
)
vals
=
self
.
subSectionValues
.
get
(
metaInfo
.
name
,
None
)
...
...
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