-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add python bindings for writing Frames (#447)
* Add put method to Frame python bindings * Add a test that writes a file via the python bindings and ROOT * Add a c++ test that reads content written in python * Add a put_parameter method to the python Frame
- Loading branch information
Showing
13 changed files
with
411 additions
and
14 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python3 | ||
"""Python module for defining the basic writer interface that is used by the | ||
backend specific bindings""" | ||
|
||
|
||
class BaseWriterMixin: | ||
"""Mixin class that defines the base interface of the writers. | ||
The backend specific writers inherit from here and have to initialize the | ||
following members: | ||
- _writer: The actual writer that is able to write frames | ||
""" | ||
|
||
def write_frame(self, frame, category, collections=None): | ||
"""Write the given frame under the passed category, optionally limiting the | ||
collections that are written. | ||
Args: | ||
frame (podio.frame.Frame): The Frame to write | ||
category (str): The category name | ||
collections (optional, default=None): The subset of collections to | ||
write. If None, all collections are written | ||
""" | ||
# pylint: disable-next=protected-access | ||
self._writer.writeFrame(frame._frame, category, collections or frame.collections) |
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
Oops, something went wrong.