Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse unknown message IDs #65

Merged
merged 3 commits into from
Sep 15, 2024
Merged

parse unknown message IDs #65

merged 3 commits into from
Sep 15, 2024

Conversation

semuadmin
Copy link
Contributor

@semuadmin semuadmin commented Sep 15, 2024

pynmeagps Pull Request Template

ENHANCEMENTS:

  1. Enhance NMEAMessage to parse unrecognised* NMEA sentence types to a nominal <NMEA(TTXXX, NOMINAL, field_01=x...)> message structure if VALMSGID validation flag is not set, rather than raise a NMEAParseMessage error e.g.:

    A. with the VALMSGID flag not set (the new default behaviour):

    from pynmeagps import NMEAReader
    msg = NMEAReader.parse("$GNACN,103607.00,ECN,E,A,W,A,test,C*67\r\n")
    print(msg)
    <NMEA(GNACN, NOMINAL, field_01=103607.00, field_02=ECN, field_03=E, field_04=A, field_05=W, field_06=A, field_07=test, field_08=C)>
    

    B. with the VALMSGID flag set:

    from pynmeagps import NMEAReader, VALMSGID
    msg = NMEAReader.parse("$GNACN,103607.00,ECN,E,A,W,A,test,C*67\r\n", validate=VALMSGID)
    print(msg)
    pynmeagps.exceptions.NMEAParseError: Unknown msgID GNACN, msgmode GET.
    

    * unrecognised message types include those with unknown or invalid NMEA msgIDs (but valid payloads and checksums), or valid NMEA sentences whose payload definitions are not yet in the public domain (e.g. those currently commented-out in NMEA_MSGIDS).

  2. Add NMEA ALF sentence definition.

  3. Add validate argument to NMEAMessage and carry forward from NMEAReader

  4. Add logger to NMEAMessage.

Testing

Please test all changes, however trivial, against the supplied pytest suite tests/test_*.py. Please describe any test cases you have amended or added to this suite to maintain >= 99% code coverage.

  • parse tests updated

Checklist:

  • I agree to abide by the code of conduct (see CODE_OF_CONDUCT.md).
  • My code follows the style guidelines of this project (see CONTRIBUTING.md).
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • (if appropriate) I have added test cases to the tests/test_*.py unittest suite to maintain >= 99% code coverage.
  • I have tested my code against the full tests/test_*.py unittest suite.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I have signed my commits.
  • I understand and acknowledge that the code will be published under a BSD 3-Clause license.

@semuadmin semuadmin added the enhancement New feature or request label Sep 15, 2024
@semuadmin semuadmin added this to the RC 1.0.41 milestone Sep 15, 2024
@semuadmin semuadmin self-assigned this Sep 15, 2024
@semuadmin semuadmin marked this pull request as draft September 15, 2024 13:57
@semuadmin semuadmin requested a review from a team September 15, 2024 13:58
@semuadmin semuadmin marked this pull request as ready for review September 15, 2024 14:42
@semuadmin semuadmin merged commit 3814785 into master Sep 15, 2024
6 checks passed
@semuadmin semuadmin deleted the RC-1.0.41 branch September 15, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants