-
Notifications
You must be signed in to change notification settings - Fork 2
bind select pflib functions to python
#244
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
Merged
Merged
Conversation
This file contains hidden or 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 was
linked to
issues
Nov 11, 2025
15f9489 to
2f722bc
Compare
Member
Author
|
🚀 😎 stuff is looking good,
# on the ZCU
[eichl008@umn-zcu102-ldmx build]$ python3
Python 3.9.21 (main, Aug 19 2025, 00:00:00)
[GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pypflib
>>> pypflib.logging.open(color = True)
>>> tgt = pypflib.PyTarget({})
creating { }
>>> tgt.start_run()
start_run
>>> ep = tgt.grab_pedestals()
>>> ep
<pypflib.WordVector object at 0xffffa9737c10>
>>> [hex(w) for w in ep]
['0x3ffc1051', '0xf313f02b', '0xe5006f', '0xe045801f', '0xffffffff', '0xc532000', '0xa427c00', '0xa329000', '0xb52d400', '0xd735c00', '0xd234400', '0xbf2f800', '0xdd36c00', '0xd333c00', '0xc330c00', '0xdb36c00', '0xe739c00', '0xcd33400', '0xd234c00', '0xe338800', '0xe137c00', '0xe539400', '0xcd33800', '0xd935c00', '0xcf34400', '0xc732400', '0xdf37c00', '0xcf33c00', '0xdf37c00', '0xe338c00', '0xf53c800', '0xe93a800', '0xcc33000', '0xc531c00', '0xdd36c00', '0xd334c00', '0xc932800', '0xcb33400', '0xd736400', '0xd735c00', '0xb92e400', '0xbf2fc00', '0xe043801f', '0xffffffff', '0xe639c00', '0xbf2fc00', '0xc431400', '0xd535400', '0xc230c00', '0xb72dc00', '0xbf30800', '0xa82a800', '0xd935c00', '0xcf33c00', '0xe238400', '0xcd33800', '0xd535400', '0xd634800', '0xc331400', '0xb92e400', '0xbf2fc00', '0xe93a400', '0xe338c00', '0xea3a800', '0xed3b400', '0xe539400', '0xe739800', '0xf83d800', '0xdf37c00', '0xfc3f400', '0xdd37400', '0xcf33800', '0xeb3ac00', '0xc731800', '0xcf33c00', '0xab2b000', '0xc331400', '0xd334400', '0xd134800', '0xb32dc00', '0xbd2f400', '0x6405598e']
>>> econ = pypflib.ECONDEventPacket(1)
>>> econ._from(ep[1:])
(2025-11-12 22:30:04) [decoding] warn: Event header 8b CRC does not match trasmitted value: 00100101 != 01101111
(2025-11-12 22:30:04) [decoding] warn: CRC over all link sub-packets does not match transmitted value 0x1586df11 != 0xe043801f |
std::unique_ptr prevents the copy constructor from being deduced but the python bindings need a copy constructor, maybe implement my own, maybe bind `pflib::Target` with `no_init` and then bind the factory fucntions for creation
- do submodules within pypflib - bind logging open/set/close as well - update building to avoid circular linkage
its now in a separate library
4b4020e to
195edfa
Compare
pflib functions to python
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I don't actually have an idea of what commands to be included here, but hopefully this is a good enough example to get the ball rolling. The basic structure of holding a
pflib::Targetis defined and it is shown how we can define specific functions that are then call-able from Python via thepypflibPython module.Bindings
std::shared_ptr<pflib::Target>in aPyTargetwhich defines the various run commandsversionnamespacegit_describeandtagloggingnamespacelevel,open,close,setpackingnamespaceECONDEventPacketTo Do
__repr__and__doc__attributes to bindings