Skip to content

Fix bugs in filter_features command line utility. - #660

Merged
desilinguist merged 6 commits into
mainfrom
598-fix-filter-features
Feb 5, 2021
Merged

Fix bugs in filter_features command line utility.#660
desilinguist merged 6 commits into
mainfrom
598-fix-filter-features

Conversation

@desilinguist

Copy link
Copy Markdown
Collaborator

This PR closes #598.

  • Run any labels specified via -L through safe_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).
  • Change the command line arguments for filter_features to make them more intuitive to newcomers. This breaks backwards compatibility but it's worth it. Specifically, input and output files must be specified using -i and -o respectively, and inversion is now effected by using --inverse.
  • Update existing filter_feature tests to use the new command line arguments.
  • Add new tests for the label conversion.
  • Update the filter_features documentation with the new arguments as well as by adding a new warning.

- 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

codecov Bot commented Feb 4, 2021

Copy link
Copy Markdown

Codecov Report

Merging #660 (2779d6c) into main (07de429) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #660   +/-   ##
=======================================
  Coverage   95.09%   95.10%           
=======================================
  Files          27       27           
  Lines        3101     3104    +3     
=======================================
+ Hits         2949     2952    +3     
  Misses        152      152           
Impacted Files Coverage Δ
skll/utils/commandline/filter_features.py 98.48% <100.00%> (+0.07%) ⬆️

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 07de429...2779d6c. Read the comment docs.

@mulhod mulhod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me!

One very minor editing comment. Address if you have the inclination.

Comment thread doc/utilities.rst Outdated
Co-authored-by: Matt Mulholland <mulhodm@gmail.com>
@desilinguist
desilinguist merged commit 3e26acd into main Feb 5, 2021
@delete-merged-branch
delete-merged-branch Bot deleted the 598-fix-filter-features branch February 5, 2021 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two bugs in filter_features

3 participants