-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix accessing input file metadata in MetadataSvc #223
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d994b12
add tests for reading metadata from file
m-fila e7788c2
fix frame variable shadowing in metadata service interface
m-fila e0dd7d0
fix get metadata not checking if frame exists
m-fila 9d20151
make methods const when appropriate
m-fila cd3ce7b
Update test/k4FWCoreTest/options/CheckOutputFiles.py
m-fila 9c5264f
use dict for expected metadata in check_metadata
m-fila e53afba
fix input/output property name
m-fila d6061c4
Merge branch 'main' into metadatasvc
jmcarcell 38f8bd2
don't make getFrame public
m-fila File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
test/k4FWCoreTest/options/ExampleFunctionalMetadataRead.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Copyright (c) 2014-2024 Key4hep-Project. | ||
# | ||
# This file is part of Key4hep. | ||
# See https://key4hep.github.io/key4hep-doc/ for further info. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# This is an example accessing matadata read from input file using MetadataSvc | ||
|
||
from Gaudi.Configuration import INFO | ||
from Configurables import ExampleFunctionalMetadataConsumer | ||
from k4FWCore import ApplicationMgr, IOSvc | ||
from Configurables import EventDataSvc | ||
|
||
iosvc = IOSvc() | ||
iosvc.Input = "functional_metadata.root" | ||
iosvc.Output = "functional_metadata_propagate.root" | ||
|
||
consumer = ExampleFunctionalMetadataConsumer("Consumer", InputCollection=["MCParticles"]) | ||
|
||
ApplicationMgr( | ||
TopAlg=[consumer], | ||
EvtSel="NONE", | ||
EvtMax=10, | ||
ExtSvc=[EventDataSvc("EventDataSvc")], | ||
OutputLevel=INFO, | ||
) |
39 changes: 39 additions & 0 deletions
39
test/k4FWCoreTest/options/ExampleFunctionalMetadataReadOldAlgorithm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Copyright (c) 2014-2024 Key4hep-Project. | ||
# | ||
# This file is part of Key4hep. | ||
# See https://key4hep.github.io/key4hep-doc/ for further info. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# This is an example accessing matadata read from input file using MetaDataHandle | ||
|
||
from Gaudi.Configuration import INFO | ||
from Configurables import k4FWCoreTest_cellID_reader | ||
from k4FWCore import ApplicationMgr, IOSvc | ||
|
||
iosvc = IOSvc() | ||
iosvc.Input = "functional_metadata_old_algorithm.root" | ||
iosvc.Output = "functional_metadata_old_algorithm_propagate.root" | ||
|
||
consumer = k4FWCoreTest_cellID_reader() | ||
|
||
ApplicationMgr( | ||
TopAlg=[consumer], | ||
EvtSel="NONE", | ||
EvtMax=10, | ||
ExtSvc=[], | ||
OutputLevel=INFO, | ||
StopOnSignal=True, | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it private and the IOSvc a friend of the MetadataSvc or something to hide from other users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved
getFrame
inIMetadataSvc
(interface) to protected and made friends withWriter