Fix NMEAReader to correctly process VALMSGID flag. If the NMEA message is valid (i.e. checksum is good) but unknown;
NMEAReader.parse(validate=VALMSGID) method will raise an NMEAParseError
NMEAReader.parse(validate=0) method will return None
NB: the VALMSGID flag is only intended to allow valid but unknown NMEA messages to be ignored. If the NMEA stream message is garbage, other parsing errors may still be raised. These can be ignored by setting the quitonerror flag to False.
Fixes #25
Testing
Please test all changes, however trivial, against the supplied unittest suite tests/test_*.py e.g. by executing the tests/testsuite.py module or using your IDE's native Python unittest integration facilities. Please describe any test cases you have amended or added to this suite to maintain >= 99% code coverage.
[x] additional tests added to test_parse
Checklist:
[x] My code follows the style guidelines of this project (see CONTRIBUTING.MD).
[x] I have performed a self-review of my own code.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] I have made corresponding changes to the documentation.
[x] (if appropriate) I have added test cases to the tests/test_*.py unittest suite to maintain >= 99% code coverage.
[x] I have tested my code against the full tests/test_*.py unittest suite.
[x] My changes generate no new warnings.
[x] Any dependent changes have been merged and published in downstream modules.
[x] I understand and acknowledge that the code will be published under a BSD 3-Clause license.
pynmeagps Pull Request Template
Description
Fix NMEAReader to correctly process VALMSGID flag. If the NMEA message is valid (i.e. checksum is good) but unknown;
NMEAReader.parse(validate=VALMSGID)
method will raise anNMEAParseError
NMEAReader.parse(validate=0)
method will returnNone
NB: the VALMSGID flag is only intended to allow valid but unknown NMEA messages to be ignored. If the NMEA stream message is garbage, other parsing errors may still be raised. These can be ignored by setting the
quitonerror
flag to False.Fixes #25
Testing
Please test all changes, however trivial, against the supplied unittest suite
tests/test_*.py
e.g. by executing thetests/testsuite.py
module or using your IDE's native Python unittest integration facilities. Please describe any test cases you have amended or added to this suite to maintain >= 99% code coverage.Checklist:
CONTRIBUTING.MD
).tests/test_*.py
unittest suite to maintain >= 99% code coverage.tests/test_*.py
unittest suite.