tessl install tessl/pypi-pynmea2@1.19.0Python library for parsing and generating NMEA 0183 protocol messages used in GPS and marine navigation systems
Agent Success
Agent success rate when using this tile
77%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.12x
Baseline
Agent success rate without this tile
69%
Build a GPS data stream processor that reads marine navigation sentences from continuous data streams and extracts position information.
The processor should handle continuous streams of GPS data (e.g., from serial ports, network sockets, or files). The stream may contain:
Extract and track GPS position data including:
The processor must handle errors appropriately:
The processor should output position data in a readable format showing:
@generates
class GPSStreamProcessor:
"""
Processes continuous streams of GPS navigation data and extracts position information.
The processor handles buffering of partial lines, parsing of navigation sentences,
and extraction of position data with appropriate error handling.
"""
def __init__(self, error_mode='raise'):
"""
Initialize the GPS stream processor.
Args:
error_mode (str): How to handle parsing errors. Options: 'raise', 'ignore', 'yield'
"""
pass
def process_stream(self, stream):
"""
Process a stream of GPS data and yield position information.
Args:
stream: An iterable that yields chunks of GPS data (strings or bytes)
Yields:
dict: Position information with keys 'timestamp', 'latitude', 'longitude', 'valid'
"""
pass
def process_file(self, file_path):
"""
Process a file containing GPS data and return all positions.
Args:
file_path (str): Path to the file containing GPS data
Returns:
list: List of position dictionaries
"""
passProvides NMEA 0183 sentence parsing and stream processing support.