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

feat: --skip-validation allows mismatched Augur versions #902

Merged
merged 3 commits into from
Jul 28, 2022

Conversation

corneliusroemer
Copy link
Member

Description of proposed changes

Currently, files produced by Augur contain the version of the Augur instance used to produce the data file.

When there's a major version mismatch between the version a file was produced with and the version of Augur export, Augur throws an error complaining about version mismatch.

While it's a good thing to warn the user, there are situations where one may want to take the risk and allow Augur export to use output from different versions.

This PR extends the meaning of the --skip-validation argument to also not complain about version mismatch in input files.

--skip-validation was introduced in #865

Related issue(s)

Fixes #901
Related to #865

Testing

I added integration tests

@codecov
Copy link

codecov bot commented Apr 25, 2022

Codecov Report

Merging #902 (2be8e8c) into master (a49914a) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 2be8e8c differs from pull request most recent head 61f2ae0. Consider uploading reports for the commit 61f2ae0 to get more accurate results

@@            Coverage Diff             @@
##           master     #902      +/-   ##
==========================================
+ Coverage   59.64%   59.67%   +0.02%     
==========================================
  Files          53       53              
  Lines        6317     6319       +2     
  Branches     1586     1586              
==========================================
+ Hits         3768     3771       +3     
+ Misses       2286     2285       -1     
  Partials      263      263              
Impacted Files Coverage Δ
augur/export_v2.py 69.04% <100.00%> (+0.15%) ⬆️
augur/util_support/node_data_file.py 100.00% <100.00%> (ø)
augur/util_support/node_data_reader.py 100.00% <100.00%> (ø)
augur/utils.py 64.25% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a49914a...61f2ae0. Read the comment docs.

Copy link
Contributor

@huddlej huddlej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @corneliusroemer! I had a couple minor comments about the tests, but otherwise good to merge. (Thank you for adding tests!)

@@ -9,8 +9,9 @@


class NodeDataFile:
def __init__(self, fname):
def __init__(self, fname, skip_validation=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's annoying to pass around this variable through multiple classes. This isn't ideal OO design and an OO implementation is even what we need here. Your implementation here seems fine, in the current context. We should leave to another PR to reimplement the node data reader as a function again. 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

jameshadfield added a commit that referenced this pull request Jun 1, 2022
As suggested by @huddlej in PR #902
Tests originally implemented by @corneliusroemer
@jameshadfield jameshadfield force-pushed the skip-version-validation branch from 6cff6e7 to 404595d Compare June 1, 2022 06:00
@jameshadfield
Copy link
Member

I really needed this today so I took it upon myself to implement John's PR suggestions & also rebased it onto current master (99 commits ahead!). I think this should be merged 🙏

@jameshadfield
Copy link
Member

Test failure is the same as seen on another PR: #961 (comment) and seems unrelated to this PR 😕

@victorlin victorlin force-pushed the skip-version-validation branch from 404595d to c74c2ab Compare July 28, 2022 17:34
@victorlin
Copy link
Member

This was bumped in Slack. Force-pushed a rebase on latest master, then I'll merge once tests pass.

@victorlin victorlin force-pushed the skip-version-validation branch from 2be8e8c to 61f2ae0 Compare July 28, 2022 18:38
@victorlin victorlin merged commit ea56c4e into master Jul 28, 2022
@victorlin victorlin deleted the skip-version-validation branch July 28, 2022 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

ENH: Add flag that ignores version mismatch checks in export
4 participants