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
4cc0acd7
Commit
4cc0acd7
authored
4 years ago
by
Michal Leszczynski
Browse files
Options
Downloads
Patches
Plain Diff
Move ignoreIrrelevant option application to file loading function
parent
fa7ed7ea
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/share/confTool.py
+22
-18
22 additions, 18 deletions
Control/AthenaConfiguration/share/confTool.py
with
22 additions
and
18 deletions
Control/AthenaConfiguration/share/confTool.py
+
22
−
18
View file @
4cc0acd7
...
...
@@ -78,6 +78,19 @@ def parse_args():
def
main
(
args
):
if
args
.
ignoreIrrelevant
:
args
.
ignoreList
=
[
"
StoreGateSvc
"
,
"
OutputLevel
"
,
"
MuonEDMHelperSvc
"
,
"
ExtraInputs
"
,
"
ExtraOutputs
"
,
"
DetStore
"
,
"
EvtStore
"
,
"
NeededResources
"
,
]
print
(
f
"
Components to ignore:
{
args
.
ignoreList
}
"
)
if
args
.
printComps
:
for
fileName
in
args
.
file
:
conf
=
_loadSingleFile
(
fileName
,
args
)
...
...
@@ -124,18 +137,6 @@ def main(args):
if
isinstance
(
chk
,
dict
):
flattenedChk
.
update
(
chk
)
if
args
.
ignoreIrrelevant
:
args
.
ignoreList
=
[
"
StoreGateSvc
"
,
"
OutputLevel
"
,
"
MuonEDMHelperSvc
"
,
"
ExtraInputs
"
,
"
ExtraOutputs
"
,
"
DetStore
"
,
"
EvtStore
"
,
"
NeededResources
"
,
]
print
(
f
"
Components to ignore:
{
args
.
ignoreList
}
"
)
_compareConfig
(
flattenedRef
,
flattenedChk
,
args
)
...
...
@@ -214,6 +215,15 @@ def _loadSingleFile(fname, args):
if
isinstance
(
dic
,
dict
)
]
if
args
.
ignoreIrrelevant
:
def
remove_irrelevant
(
val_dict
):
return
{
key
:
val
for
key
,
val
in
val_dict
.
items
()
if
key
not
in
args
.
ignoreList
}
conf
=
[
{
key
:
remove_irrelevant
(
value
)
for
(
key
,
value
)
in
dic
.
items
()}
for
dic
in
conf
if
isinstance
(
dic
,
dict
)
]
return
conf
...
...
@@ -296,9 +306,6 @@ def _compareComponent(compRef, compChk, prefix, args, component):
allProps
.
sort
()
for
prop
in
allProps
:
if
args
.
ignoreIrrelevant
and
prop
in
args
.
ignoreList
:
continue
if
prop
not
in
compRef
.
keys
():
print
(
"
%s%s = %s:
\033
[94m exists only in 2nd file
\033
[0m
\033
[91m<< !!!
\033
[0m
"
...
...
@@ -324,9 +331,6 @@ def _compareComponent(compRef, compChk, prefix, args, component):
except
ValueError
:
pass
# literal_eval exception when parsing particular strings
if
args
.
ignoreIrrelevant
and
chkVal
in
args
.
ignoreList
:
continue
refVal
,
chkVal
=
_parseNumericalValues
(
refVal
,
chkVal
)
if
str
(
chkVal
)
==
str
(
refVal
):
...
...
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