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
b3637336
Commit
b3637336
authored
4 years ago
by
Walter Lampl
Committed by
Frank Winklmeier
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ComponentAccumulator: Verify arguments of methods adding components
parent
cc9b22f3
No related branches found
Branches containing commit
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
+17
-3
17 additions, 3 deletions
Control/AthenaConfiguration/python/ComponentAccumulator.py
with
17 additions
and
3 deletions
Control/AthenaConfiguration/python/ComponentAccumulator.py
+
17
−
3
View file @
b3637336
...
...
@@ -9,6 +9,7 @@ from AthenaCommon.Constants import INFO
import
GaudiKernel.GaudiHandles
as
GaudiHandles
import
GaudiConfig2
import
AthenaPython
from
AthenaConfiguration.Deduplication
import
deduplicate
,
DeduplicationFailed
import
collections
...
...
@@ -331,8 +332,11 @@ class ComponentAccumulator(object):
raise
ConfigurationError
(
"
Can not find sequence %s
"
%
sequenceName
)
for
algo
in
algorithms
:
if
algo
.
__component_type__
!=
"
Algorithm
"
:
if
not
isinstance
(
algo
,
GaudiConfig2
.
_configurables
.
Configurable
)
and
not
isinstance
(
algo
,
AthenaPython
.
Configurables
.
CfgPy
Algorithm
)
:
raise
TypeError
(
"
Attempt to add wrong type: %s as event algorithm
"
%
type
(
algo
).
__name__
)
if
algo
.
__component_type__
!=
"
Algorithm
"
:
raise
TypeError
(
"
Attempt to add an %s as event algorithm
"
%
algo
.
__component_type__
)
if
algo
.
name
in
self
.
_algorithms
:
self
.
_algorithms
[
algo
.
name
].
merge
(
algo
)
...
...
@@ -368,8 +372,11 @@ class ComponentAccumulator(object):
return
list
(
set
(
sum
(
flatSequencers
(
seq
,
algsCollection
=
self
.
_algorithms
).
values
(),
[])
)
)
def
addCondAlgo
(
self
,
algo
,
primary
=
False
):
if
algo
.
__component_type__
!=
"
Algorithm
"
:
if
not
isinstance
(
algo
,
GaudiConfig2
.
_configurables
.
Configurable
)
and
not
isinstance
(
algo
,
AthenaPython
.
Configurables
.
CfgPy
Algorithm
)
:
raise
TypeError
(
"
Attempt to add wrong type: %s as conditions algorithm
"
%
type
(
algo
).
__name__
)
if
algo
.
__component_type__
!=
"
Algorithm
"
:
raise
TypeError
(
"
Attempt to add wrong type: %s as conditions algorithm
"
%
algo
.
__component_type__
)
pass
deduplicate
(
algo
,
self
.
_conditionsAlgs
)
#will raise on conflict
if
primary
:
...
...
@@ -389,6 +396,10 @@ class ComponentAccumulator(object):
return
hits
[
0
]
def
addService
(
self
,
newSvc
,
primary
=
False
,
create
=
False
):
if
not
isinstance
(
newSvc
,
GaudiConfig2
.
_configurables
.
Configurable
)
and
not
isinstance
(
newSvc
,
AthenaPython
.
Configurables
.
CfgPyService
):
raise
TypeError
(
"
Attempt to add wrong type: %s as service
"
%
type
(
newSvc
).
__name__
)
if
newSvc
.
__component_type__
!=
"
Service
"
:
raise
TypeError
(
"
Attempt to add wrong type: %s as service
"
%
newSvc
.
__component_type__
)
pass
...
...
@@ -408,8 +419,11 @@ class ComponentAccumulator(object):
return
def
addPublicTool
(
self
,
newTool
,
primary
=
False
):
if
not
isinstance
(
newTool
,
GaudiConfig2
.
_configurables
.
Configurable
)
and
not
isinstance
(
newTool
,
AthenaPython
.
Configurables
.
CfgPyAlgTool
):
raise
TypeError
(
"
Attempt to add wrong type: %s as public AlgTool
"
%
type
(
newTool
).
__name__
)
if
newTool
.
__component_type__
!=
"
AlgTool
"
:
raise
TypeError
(
"
Attempt to add wrong type: %s as AlgTool
"
%
type
(
newTool
)
.
__
nam
e__
)
raise
TypeError
(
"
Attempt to add wrong type: %s as
public
AlgTool
"
%
newTool
.
__
component_typ
e__
)
deduplicate
(
newTool
,
self
.
_publicTools
)
if
primary
:
...
...
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