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

[FIX] Gracefully handle user providing phenotypic file as .csv #212

Merged
merged 13 commits into from
Sep 26, 2023

Conversation

surchs
Copy link
Contributor

@surchs surchs commented Sep 22, 2023

Closes #90

Changes proposed in this pull request:

  • raise errors if
    • user provides a file ending in .csv
    • user provides a .tsv file, that really is just a repackaged .csv file -> we're not fooled 👀

Checklist

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see https://neurobagel.org/contributing/pull_requests for more info)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

for now only checks the file ending of the pheno file
Someone sharing a .tsv file that really is a .csv
will also get flagged
@github-actions
Copy link

github-actions bot commented Sep 22, 2023

Pull Request Test Coverage Report for Build 6316815673

  • 36 of 36 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.007%) to 99.678%

Totals Coverage Status
Change from base Build 6314697288: 0.007%
Covered Lines: 1239
Relevant Lines: 1243

💛 - Coveralls

@alyssadai alyssadai self-requested a review September 22, 2023 21:58
Copy link
Contributor

@alyssadai alyssadai left a comment

Choose a reason for hiding this comment

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

Thanks @surchs for addressing this!

Everything seems good functionally, but I've left a few clarification questions and 🍒 comments below I think would be worth having another look at.

bagel/pheno_utils.py Outdated Show resolved Hide resolved
bagel/pheno_utils.py Outdated Show resolved Hide resolved
bagel/pheno_utils.py Outdated Show resolved Hide resolved
bagel/pheno_utils.py Outdated Show resolved Hide resolved
bagel/tests/test_cli_pheno.py Outdated Show resolved Hide resolved
bagel/tests/data/README.md Show resolved Hide resolved
@surchs surchs requested a review from alyssadai September 25, 2023 19:48
Copy link
Contributor

@alyssadai alyssadai left a comment

Choose a reason for hiding this comment

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

Two 🍒 suggestions, otherwise looks good to go!!

bagel/pheno_utils.py Outdated Show resolved Hide resolved
bagel/pheno_utils.py Outdated Show resolved Hide resolved
@surchs surchs mentioned this pull request Sep 26, 2023
1 task
@surchs surchs merged commit 3ae6fcc into main Sep 26, 2023
@surchs surchs deleted the surchs/issue90 branch September 26, 2023 18:28
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.

If user provides .csv instead of .tsv, bagel pheno CLI fails with nice looking but incorrect error
2 participants