Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dafe39f

Browse files
committedMar 5, 2025··
MNT: Update documentation/changelog for generic packet interface
1 parent e6d5fe6 commit dafe39f

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed
 

‎docs/source/changelog.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Release notes for the `space_packet_parser` library
1414
- Add support for creating a packet definition from Python objects and serializing it as XML.
1515
- BUGFIX: Fix kbps calculation in packet generator for showing progress.
1616
- Add support for string and float encoded enumerated lookup parameters.
17-
- Add properties to extract the CCSDS Header items from the ``RawPacketData`` object directly.
18-
e.g. ``RawPacketData.apid``
17+
- Add properties to extract the CCSDS Header items from the ``CCSDSPacketBytes`` object directly.
18+
e.g. ``CCSDSPacketBytes.apid``
1919
- Add a ``create_ccsds_packet`` function that can create a CCSDS Packet
2020
with the given header items and data. This is useful for creating
2121
mock packets in testing and experimentation for creating debugging

‎docs/source/users.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ We aim to provide examples of usage patterns. Please see the `examples` director
4545
a specific example you want to see demonstrated, please open a GitHub Issue or Discussion for support.
4646

4747
## Packet Objects
48-
The object returned from the `packet_generator` is a `CCSDSPacket` (unless you're yielding parsing
48+
The object returned from the `packet_generator` is a `Packet` (unless you're yielding parsing
4949
exceptions for debugging). This object subclasses a python dictionary and behaves as a dictionary. To retrieve
5050
a parameter value from the yielded packet, you can iterate over its `items()` or you can access individual parameters
5151
by name.

‎space_packet_parser/packets.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,10 @@ class to extract the header fields with specific methods.
282282
make up the user data (accessed with ``CCSDSPacket.user_data``). To access the
283283
raw bytes of the packet, use the ``CCSDSPacket.raw_data`` attribute.
284284
"""
285-
pass
285+
def __init__(self, *args, **kwargs):
286+
warnings.warn("The CCSDSPacket class is deprecated and will be removed in a future release. "
287+
"Use the Packet class instead (no CCSDS prefix).")
288+
super().__init__(*args, **kwargs)
286289

287290

288291
def ccsds_generator(

‎tests/unit/test_packets.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ def test_packet_data_lookups():
127127
def test_ccsds_packet_data_lookups():
128128
# Deprecated CCSDSPacket class, an instance of the new Packet class
129129
# can be removed in a future version
130-
assert isinstance(packets.CCSDSPacket(), packets.Packet)
130+
with pytest.warns(UserWarning, match="The CCSDSPacket class is deprecated"):
131+
assert isinstance(packets.CCSDSPacket(), packets.Packet)
131132

132133

133134
def test_continuation_packets(test_data_dir):

0 commit comments

Comments
 (0)
Please sign in to comment.