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

Allow customization of input metadata delimiter #1196

Merged
merged 5 commits into from
Apr 12, 2023

Conversation

victorlin
Copy link
Member

@victorlin victorlin commented Apr 6, 2023

Description of proposed changes

Allow customization of input metadata delimiter

Previously, there was hardcoded support for , and \t. Remove the hardcoding by:

  1. Making valid delimiters a required parameter to read_metadata().
  2. In subcommands, adding a new flag --metadata-valid-delimiters with a default of the previously hardcoded delimiters, and passing that list into read_metadata().

Related issue(s)

Follow-up to breaking change from #812.

Testing

  • Tests updated
  • Checks pass

Checklist

  • Add a message in CHANGES.md summarizing the changes in this PR that are end user focused. Keep headers and formatting consistent with the rest of the file.

@victorlin victorlin force-pushed the victorlin/metadata-valid-delimiters branch from 106db00 to 8e298f5 Compare April 7, 2023 21:46
@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Patch coverage: 80.28% and project coverage change: -0.04 ⚠️

Comparison is base (2996ea3) 68.38% compared to head (c0a9ddb) 68.34%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1196      +/-   ##
==========================================
- Coverage   68.38%   68.34%   -0.04%     
==========================================
  Files          64       64              
  Lines        6816     6853      +37     
  Branches     1662     1663       +1     
==========================================
+ Hits         4661     4684      +23     
- Misses       1845     1858      +13     
- Partials      310      311       +1     
Impacted Files Coverage Δ
augur/curate/__init__.py 88.88% <60.00%> (-4.96%) ⬇️
augur/export_v2.py 68.62% <71.42%> (-0.12%) ⬇️
augur/frequencies.py 52.00% <71.42%> (+0.33%) ⬆️
augur/refine.py 65.34% <71.42%> (-0.32%) ⬇️
augur/export_v1.py 74.16% <75.00%> (-0.31%) ⬇️
augur/traits.py 84.25% <75.00%> (-1.00%) ⬇️
augur/filter/__init__.py 100.00% <100.00%> (ø)
augur/filter/_run.py 94.47% <100.00%> (+0.08%) ⬆️
augur/io/metadata.py 96.27% <100.00%> (+0.07%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@victorlin victorlin marked this pull request as ready for review April 7, 2023 22:21
@victorlin victorlin requested a review from a team April 7, 2023 22:21
Copy link
Member

@tsibley tsibley left a comment

Choose a reason for hiding this comment

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

Very much +1 for the direction of this change!

One minor thing, but that I think is still important, is the use of the word "valid". I don't think it's quite on the nose here. I think "allowed" or "possible" would be better choices that more clearly represent the user's (or caller's) perspective rather than the internal perspective of read_metadata().

augur/io/metadata.py Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
@j23414
Copy link
Contributor

j23414 commented Apr 11, 2023

+1 for adding this functionality. Especially since commas are used as a decimal in some countries, and then the default delimiter can be semicolons.

Previously, there was hardcoded support for `,` and `\t`. Remove the hardcoding by:

1. Making valid delimiters a required parameter to `read_metadata()`.
2. In subcommands, adding a new flag `--metadata-valid-delimiters` with
   a default of the previously hardcoded delimiters, and passing that
   list into `read_metadata()`.
@victorlin victorlin force-pushed the victorlin/metadata-valid-delimiters branch from 2bbf928 to 1ac4649 Compare April 12, 2023 17:47
These examples are already shown in the help text with the default
value.
The previous wording of these option descriptions did not rule out using
multiple values at once. This change makes it clear that only one value
is inferred.
@victorlin victorlin requested a review from tsibley April 12, 2023 17:59
Copy link
Member

@tsibley tsibley left a comment

Choose a reason for hiding this comment

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

Looks good!

augur/filter/__init__.py Outdated Show resolved Hide resolved
augur/io/metadata.py Show resolved Hide resolved
Copy useful wording from the corresponding parameter description in
augur.io.metadata.read_metadata().
@victorlin victorlin merged commit 6da1c53 into master Apr 12, 2023
@victorlin victorlin deleted the victorlin/metadata-valid-delimiters branch April 12, 2023 18:39
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.

3 participants