File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
src/ml_flashpoint/checkpoint_object_manager Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 1919
2020
2121class BufferMetadataType (ctypes .LittleEndianStructure ):
22- """Metadata block stored at the beginning of the BufferIO buffer."""
22+ """Defines the structure of the metadata block stored at the beginning
23+ of the BufferIO buffer.
24+ """
2325
2426 _pack_ = 1 # Ensure tight packing for cross-platform consistency
2527 _fields_ = [
@@ -43,5 +45,19 @@ class BufferMetadataType(ctypes.LittleEndianStructure):
4345
4446# --- Helper Function ---
4547def get_metadata_str (metadata : BufferMetadataType | None ) -> str :
46- """Returns a string representation of the BufferMetadataType object."""
47- return f"Metadata(len_written_data={ metadata .len_written_data } )" if metadata else "[Metadata: None]"
48+ """Returns a string representation of the BufferMetadataType object.
49+
50+ Args:
51+ metadata: An instance of BufferMetadataType or None.
52+
53+ Returns:
54+ A formatted string describing the metadata content, or a placeholder
55+ if metadata is None.
56+ """
57+ if metadata is None :
58+ return "[Metadata: None]"
59+ # Format the fields from the metadata object
60+ # Add more fields here if the BufferMetadataType struct expands
61+ len_data = metadata .len_written_data
62+ # You could add other relevant fields from 'reserved' if they were defined
63+ return f"Metadata(len_written_data={ len_data } )"
You can’t perform that action at this time.
0 commit comments