Fix bugs in filter_features command line utility. - #660
Merged
Conversation
- Convert any labels specified on the command line using `safe_float()` just like the labels that are read by all of the FeatureSet reader classes. This ensures that something like `-L 0 1` is interpreted correctly.
- Right now, the input and output file need to be specified _before_ any optional arguments which is unintuitive. This commit makes it such that the files also require flags but they are required.
- Add new tests to check that the label conversion works correctly. - Update existing tests to use the new command line argument flags.
- Update the command line arguments. - Add a warning explaining the backwards incompatibility and changes that will be coming up in v2.5.
Codecov Report
@@ Coverage Diff @@
## main #660 +/- ##
=======================================
Coverage 95.09% 95.10%
=======================================
Files 27 27
Lines 3101 3104 +3
=======================================
+ Hits 2949 2952 +3
Misses 152 152
Continue to review full report at Codecov.
|
aoifecahill
approved these changes
Feb 4, 2021
mulhod
approved these changes
Feb 5, 2021
mulhod
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me!
One very minor editing comment. Address if you have the inclination.
Co-authored-by: Matt Mulholland <mulhodm@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes #598.
-Lthroughsafe_float()to make sure that they are converted in the same way that the FeatureSet reader classes do for any feature files (see issue for more details).filter_featuresto make them more intuitive to newcomers. This breaks backwards compatibility but it's worth it. Specifically, input and output files must be specified using-iand-orespectively, and inversion is now effected by using--inverse.filter_featuretests to use the new command line arguments.filter_featuresdocumentation with the new arguments as well as by adding a new warning.