Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue 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
Peter Sherwood
athena
Commits
8f80c772
Commit
8f80c772
authored
6 years ago
by
TJ Khoo
Browse files
Options
Downloads
Patches
Plain Diff
Change to use isinstance for type checking. Handle public and private toolhandle arrays better.
Former-commit-id:
08a607f4
parent
13afc06c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Control/AthenaConfiguration/python/ComponentAccumulator.py
+8
-5
8 additions, 5 deletions
Control/AthenaConfiguration/python/ComponentAccumulator.py
with
8 additions
and
5 deletions
Control/AthenaConfiguration/python/ComponentAccumulator.py
+
8
−
5
View file @
8f80c772
...
@@ -7,7 +7,7 @@ from AthenaCommon.AlgSequence import AthSequencer
...
@@ -7,7 +7,7 @@ from AthenaCommon.AlgSequence import AthSequencer
from
AthenaConfiguration.AthConfigFlags
import
AthConfigFlags
from
AthenaConfiguration.AthConfigFlags
import
AthConfigFlags
import
GaudiKernel.GaudiHandles
as
GaudiHandles
import
GaudiKernel.GaudiHandles
as
GaudiHandles
from
GaudiKernel.GaudiHandles
import
PublicToolHandle
,
PublicToolHandleArray
,
ServiceHandle
,
PrivateToolHandle
from
GaudiKernel.GaudiHandles
import
PublicToolHandle
,
PublicToolHandleArray
,
ServiceHandle
,
PrivateToolHandle
,
PrivateToolHandleArray
import
ast
import
ast
import
collections
import
collections
...
@@ -72,10 +72,13 @@ class ComponentAccumulator(object):
...
@@ -72,10 +72,13 @@ class ComponentAccumulator(object):
continue
continue
propstr
=
str
(
propval
)
propstr
=
str
(
propval
)
if
propval
.
__class__
==
PublicToolHandleArray
:
if
isinstance
(
propval
,
PublicToolHandleArray
)
:
ths
=
[
str
(
th
)
for
th
in
propval
]
ths
=
[
th
.
getFullName
(
)
for
th
in
propval
]
propstr
=
"
PublicToolHandleArray([ {0} ])
"
.
format
(
'
,
'
.
join
(
ths
))
propstr
=
"
PublicToolHandleArray([ {0} ])
"
.
format
(
'
,
'
.
join
(
ths
))
elif
ConfigurableAlgTool
in
propval
.
__class__
.
__bases__
:
elif
isinstance
(
propval
,
PrivateToolHandleArray
):
ths
=
[
th
.
getFullName
()
for
th
in
propval
]
propstr
=
"
PrivateToolHandleArray([ {0} ])
"
.
format
(
'
,
'
.
join
(
ths
))
elif
isinstance
(
propval
,
ConfigurableAlgTool
):
propstr
=
propval
.
getFullName
()
propstr
=
propval
.
getFullName
()
self
.
_msg
.
info
(
"
"
*
nestLevel
+
"
* {0}: {1}
"
.
format
(
propname
,
propstr
)
)
self
.
_msg
.
info
(
"
"
*
nestLevel
+
"
* {0}: {1}
"
.
format
(
propname
,
propstr
)
)
return
return
...
@@ -426,7 +429,7 @@ class ComponentAccumulator(object):
...
@@ -426,7 +429,7 @@ class ComponentAccumulator(object):
existingAlg
=
findAlgorithm
(
dest
,
c
.
name
(),
depth
=
1
)
existingAlg
=
findAlgorithm
(
dest
,
c
.
name
(),
depth
=
1
)
if
existingAlg
:
if
existingAlg
:
if
existingAlg
!=
c
:
# if it is the same we can just skip it, else this indicates an error
if
existingAlg
!=
c
:
# if it is the same we can just skip it, else this indicates an error
raise
ConfigurationError
(
"
Duplicate algorithm %s in source and destination sequences %s
"
%
(
c
.
name
(),
src
.
name
()
)
)
raise
ConfigurationError
(
"
Duplicate algorithm %s in source and destination sequences %s
"
%
(
c
.
name
(),
src
.
name
()
)
)
else
:
# absent, adding
else
:
# absent, adding
self
.
_msg
.
debug
(
"
Merging algorithm %s to a sequence %s
"
,
c
.
name
(),
dest
.
name
()
)
self
.
_msg
.
debug
(
"
Merging algorithm %s to a sequence %s
"
,
c
.
name
(),
dest
.
name
()
)
dest
+=
c
dest
+=
c
...
...
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