File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ Release notes for the `space_packet_parser` library
77
88### v6.0.0 (unreleased)
99- * BREAKING* : ` XtcePacketDefinition ` no longer accepts a file object as input.
10- Use ` spp.xtce.definitions.XtcePacketDefinition.from_document () ` or ` spp.load_xml () ` instead.
10+ Use ` spp.xtce.definitions.XtcePacketDefinition.from_xtce () ` or ` spp.load_xtce () ` instead.
1111- * BREAKING* : Reorganization of the project into different submodules for more explicit handling
1212 of imports. There is now an ` space_packet_parser.xtce ` module with xtce representations separated
1313 into modules underneath that.
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import space_packet_parser as spp
1919
2020packet_file = Path(' my_packets.pkts' )
2121xtce_document = Path(' my_xtce_document.xml' )
22- packet_definition = spp.load_xml (xtce_document)
22+ packet_definition = spp.load_xtce (xtce_document)
2323packets = list (packet_definition.packet_generator(packet_file.open(' rb' )))
2424
2525# You can introspect the packet definition to learn about what was parsed
Original file line number Diff line number Diff line change 55from space_packet_parser .xtce .definitions import XtcePacketDefinition
66
77
8- def load_xml (filename : Union [str , Path ]) -> XtcePacketDefinition :
8+ def load_xtce (filename : Union [str , Path ]) -> XtcePacketDefinition :
99 """Create an XtcePacketDefinition object from an XTCE XML file
1010
1111 Parameters
Original file line number Diff line number Diff line change 1111class XtcePacketDefinition (definitions .XtcePacketDefinition ):
1212 def __init__ (self , xtce_document , ** kwargs ):
1313 warnings .warn ("This class is deprecated. To load a packet definition from a file "
14- "use space_packet_parser.load_xml () or "
14+ "use space_packet_parser.load_xtce () or "
1515 "space_packet_parser.xtce.definitions.XtcePacketDefinition.from_xtce() instead." )
1616 other = definitions .XtcePacketDefinition .from_xtce (xtce_document )
1717 self .__dict__ .update (other .__dict__ )
Original file line number Diff line number Diff line change 33from space_packet_parser .xtce import definitions
44
55
6- def test_load_xml (jpss_test_data_dir , tmp_path ):
7- xtcedef = space_packet_parser .load_xml (jpss_test_data_dir / "jpss1_geolocation_xtce_v1.xml" )
6+ def test_load_xtce (jpss_test_data_dir , tmp_path ):
7+ """Test high level function for loading an XTCE definition file"""
8+ xtcedef = space_packet_parser .load_xtce (jpss_test_data_dir / "jpss1_geolocation_xtce_v1.xml" )
89 assert isinstance (xtcedef , definitions .XtcePacketDefinition )
910
1011 outpath = tmp_path / "test_output.xml"
1112 xtcedef .write_xml (outpath )
1213 assert outpath .exists ()
1314
14- assert space_packet_parser .load_xml (outpath ) == xtcedef
15+ assert space_packet_parser .load_xtce (outpath ) == xtcedef
You can’t perform that action at this time.
0 commit comments