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
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Shaun Roe
athena
Commits
c8023586
Commit
c8023586
authored
4 years ago
by
Tomasz Bold
Committed by
Adam Edward Barton
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed priting of sequences after migration to GaudiConf2
parent
26911d67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Control/AthenaConfiguration/python/ComponentAccumulator.py
+83
-80
83 additions, 80 deletions
Control/AthenaConfiguration/python/ComponentAccumulator.py
Control/AthenaConfiguration/python/ComponentAccumulatorTest.py
+12
-11
12 additions, 11 deletions
...ol/AthenaConfiguration/python/ComponentAccumulatorTest.py
with
95 additions
and
91 deletions
Control/AthenaConfiguration/python/ComponentAccumulator.py
+
83
−
80
View file @
c8023586
This diff is collapsed.
Click to expand it.
Control/AthenaConfiguration/python/ComponentAccumulatorTest.py
+
12
−
11
View file @
c8023586
...
...
@@ -32,8 +32,8 @@ class TestComponentAccumulator( unittest.TestCase ):
def
AlgsConf1
(
flags
):
acc
=
ComponentAccumulator
()
a1
=
TestAlgo
(
"
Algo1
"
)
a2
=
TestAlgo
(
"
Algo2
"
)
a1
=
TestAlgo
(
"
Algo1
"
,
MyInt
=
12345
,
MyBool
=
False
,
MyDouble
=
2.718
,
MyStringVec
=
[
"
Very
"
,
"
important
"
]
)
a2
=
TestAlgo
(
"
Algo2
"
,
MyInt
=
98765
,
MyBool
=
True
,
MyDouble
=
1.41
,
MyStringVec
=
[
"
unimportant
"
]
)
return
acc
,[
a1
,
a2
]
...
...
@@ -75,9 +75,9 @@ class TestComponentAccumulator( unittest.TestCase ):
accNA1
=
AlgsConf4
(
dummyCfgFlags
)
acc
.
merge
(
accNA1
[
0
])
acc
.
addEventAlgo
(
accNA1
[
1
:],
"
sub2Sequence1
"
)
outf
=
open
(
"
testFile.pkl
"
,
"
wb
"
)
acc
.
store
(
outf
)
outf
.
close
(
)
with
open
(
"
testFile.pkl
"
,
"
wb
"
)
as
outf
:
acc
.
store
(
outf
)
acc
.
printConfig
(
withDetails
=
True
,
summariseProps
=
True
)
self
.
acc
=
acc
...
...
@@ -100,8 +100,8 @@ class TestComponentAccumulator( unittest.TestCase ):
def
test_readBackConfiguration
(
self
):
import
pickle
f
=
open
(
'
testFile.pkl
'
,
'
rb
'
)
s
=
pickle
.
load
(
f
)
with
open
(
'
testFile.pkl
'
,
'
rb
'
)
as
f
:
s
=
pickle
.
load
(
f
)
self
.
assertIsNotNone
(
s
,
"
The pickle has no content
"
)
def
test_foreach_component
(
self
):
...
...
@@ -302,24 +302,25 @@ class MergeMovingAlgorithms( unittest.TestCase ):
class
TestComponentAccumulatorAccessors
(
unittest
.
TestCase
):
def
runTest
(
self
):
ca
=
ComponentAccumulator
()
ca
.
wasMerged
()
ca
.
addEventAlgo
(
TestAlgo
(
"
alg1
"
))
self
.
assertEqual
(
len
(
ca
.
getEventAlgos
()),
1
,
"
Found single alg
"
)
# no idea why this assersts do not recognise exceptions
#
self.assertRaises(ConfigurationError, ca.getEventAlgo("alg2"))
from
.ComponentAccumulator
import
ConfigurationError
self
.
assertRaises
(
ConfigurationError
,
lambda
:
ca
.
getEventAlgo
(
"
alg2
"
))
ca
.
addEventAlgo
(
TestAlgo
(
"
alg2
"
))
self
.
assertIsNotNone
(
ca
.
getEventAlgo
(
"
alg2
"
),
"
Found single alg
"
)
self
.
assertEqual
(
len
(
ca
.
getEventAlgos
()),
2
,
"
Found single alg
"
)
#
self.assertRaises(ConfigurationError, ca.getEventAlgo()
, "
Single Alg API ambiguity
")
self
.
assertRaises
(
ConfigurationError
,
lambda
:
ca
.
getEventAlgo
()
)
#
Single Alg API ambiguity
ca
.
addPublicTool
(
dummyTool
(
name
=
"
tool1
"
)
)
self
.
assertIsNotNone
(
ca
.
getPublicTool
(),
"
Found single tool
"
)
ca
.
addPublicTool
(
dummyTool
(
name
=
"
tool2
"
)
)
#
self.assertRaises(ConfigurationError, ca.getPublicTool()
, "
Found single tool
")
self
.
assertRaises
(
ConfigurationError
,
lambda
:
ca
.
getPublicTool
()
)
#
Found single tool
class
TestDeduplication
(
unittest
.
TestCase
):
def
runTest
(
self
):
...
...
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