Knio / pynmea2

Python library for parsing the NMEA 0183 protocol (GPS)
MIT License
635 stars 223 forks source link

Changed the default of the parse function. #148

Closed barbacbd closed 2 years ago

barbacbd commented 2 years ago

** Checked is changed from False to True. The default should probably be set to ensure that the sentences are valid rather than just parsing the data for no reason.

** Altered the tests that require checked to be False so that the failures and/or checks actually happen.

128

barbacbd commented 2 years ago

This has the potential to mess with some older versions of this software. I think that this is the appropriate way to handle sentences though.

coveralls commented 2 years ago

Coverage Status

Coverage remained the same at 98.363% when pulling 08bc1a842f8f6bfb6a16fbc947b0001d8bc28e9c on barbacbd:alter_parse_default into 988c297ce82d976db9094b435a1aa290e7d5b9ed on Knio:master.

Knio commented 2 years ago

There's been much argument about this feature, and it seems the community doesn't want it, even though I mostly agree with you. See some of the older issues.

The semantics of the check flag have been muddied in the back and forth. What it means now is:

Many messages can take a varying number of parameters, so if there is no checksum, and some parameters are cut off, this is up to the constructor of the message type to validate and error, and not the main parser.

barbacbd commented 2 years ago

@Knio I only looked at the open issues and it appears that the latest was #128. It seemed like an easy enough fix. I am a bit surprised that the community does not want full validation by default. But if the community wants it then that is what they get ! = )