-
Notifications
You must be signed in to change notification settings - Fork 8
Generic packet #140
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
Generic packet #140
Conversation
8e3093c to
6000d0c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #140 +/- ##
==========================================
+ Coverage 91.89% 92.11% +0.22%
==========================================
Files 36 37 +1
Lines 2553 2614 +61
==========================================
+ Hits 2346 2408 +62
+ Misses 207 206 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7565829 to
917df01
Compare
medley56
left a comment
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.
I still am not convinced the packet_generator method on the definition object is truly generic because it's calling ccsds_generator internally to create the CCSDSPacketBytes objects for parsing. The parsing appears to be fully generic but the generation of the packet bytes seems to still rely on CCSDS.
This moves towards a generic packet interface and removes the need for passing in bytes with a read_* interface, we now wrap that in our own reader class to simplify that interaction.
We can add these properties back onto the main "Packet" class and add a user warning when being accessed to make it easier to transition to the new style and provide a helpful message.
Deprecate parse_ccsds_packet() as the XTCE spec doesn't need to know about the ccsds standard. We should handle parsing raw bytes objects and create the underlying objects for the users ourselves.
It is specific to ccsds packets and hasn't been released yet, so just keep it over there instead.
11dc83b to
714299d
Compare
714299d to
f94ece7
Compare
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.
I get it now. I noted a few really minor things. There are a bunch of typehints that read Packet instead of SpacePacket. The example and associated test you added for fix length packet parsing for non CCSDS packets is what I needed to see. LGTM
0905a0a to
8487768
Compare
This is an attempt to refactor our xtce parsing to be more generic and allow any RawDataObject, not just ccsds packets.
Thoughts/suggestions on how to make this better for other packet types are welcome!
definition.parse_packet(bytes)and not our wrapped classes that add the reading methods. Perhaps we could wrap the input bytes into our own container class within the function itself which would remove some of the user-facing need to create a RawPacketData-like object with read_* methods on it.closes #130
Checklist