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

[ancestral, translate] node data validation improvements #1440

Merged
merged 5 commits into from
Mar 19, 2024

Commits on Mar 19, 2024

  1. Fix quoting typo

    'q' is not a valid formatting type for python (it's a snakemake feature)
    jameshadfield committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    78135f8 View commit details
    Browse the repository at this point in the history
  2. node data reading: skip validation when asked to

    NodeDataFile (called by NodeDataReader, which is called by
    read_node_data) no longer attempts JSON validation when the requested
    validation mode is SKIP.
    jameshadfield committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    544b7bd View commit details
    Browse the repository at this point in the history
  3. [ancestral, translate] validate output node-data

    By leveraging the existing validation designed for reading node-data
    files we not only validate against the annotation schema but also
    perform other sanity checks on the node-data structure for which a
    schema does not (yet) exist.
    
    As part of this we add a `--validation-mode` argument following `augur
    export v2` which allows users to skip validation of the output node-data
    and (translate only) skip validation of the input node-data.
    jameshadfield committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    af2abfe View commit details
    Browse the repository at this point in the history
  4. Validation mode warn no longer exits code 2

    The help message for `--validation-mode` is very specific:
    
    > 'error' mode causes a non-zero exit status if any validation checks
    > failed, while 'warn' does not.
    
    In the actual implementation however we would print an error and exit
    with code 2 for any validation check _except_ the augur version check.
    Now, for `ValidationMode.WARN` we catch these errors and turn them into
    warnings such that augur can exit code 0 as specified.
    
    Note that during validation, any non-ValidationError exception will be
    be fatal even in `WARN`. An example of this would be errors loading the
    schema itself. See the following review comment for more:
    <#1440 (comment)>
    jameshadfield committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    a43536c View commit details
    Browse the repository at this point in the history
  5. changelog

    jameshadfield committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    01dff51 View commit details
    Browse the repository at this point in the history