Skip to content

Write XTF example failing to write packets #25

@Tdarnell

Description

@Tdarnell

Following the notebook example for writing XTF data gives the following error when modifying existing XTF packets:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[31], line 14
     12 # Write packets
     13 for packet in packets:
---> 14     f.write(packet.to_bytes())

TypeError: to_bytes() missing required argument 'length' (pos 1)

It seems the to_bytes method being used in builtins.pyi requires the following: length: SupportsIndex, byteorder: Literal["little", "big"]

this problem seems to come from my XTF files containing the following packets alongside sonar:

XTFHeaderType.navigation
42
XTFHeaderType.attitude
3
XTFHeaderType.sonar
0

I would like to modify the original data file then save a renamed copy, including these additional packets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions