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

Minor correction to unsupported file extension error message #1177

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

mariehbourget
Copy link
Member

Checklist

GitHub

  • I've given this PR a concise, self-descriptive, and meaningful title
  • I've linked relevant issues in the PR body
  • I've applied the relevant labels to this PR
  • I've assigned a reviewer

PR contents

Description

Very small PR to improve the error message when a file extension is not supported, especially for double extensions.

We previously used .stem to output the name of the faulty file without extension in the terminal.

This work great with single extension:

  • With filename = image.png : filename.stem outputs image

But not with double extensions:

  • With filename = image.ome.tif : filename.stem outputs image.ome

This PR now uses .name instead of .stem and outputs the full filename with extension in the terminal, so:

  • With filename = image.png : filename.stem outputs image.png
  • With filename = image.ome.tif : filename.name outputs image.ome.tif

Linked issues

No related issues in ivadomed.
It was raised in ADS PR629 where we use the same code to check file extensions.

@mariehbourget mariehbourget added the refactoring PRs/Issues that solely deal with existing code reorganization label Jul 6, 2022
@mariehbourget mariehbourget requested a review from dyt811 July 6, 2022 16:06
@coveralls
Copy link

Pull Request Test Coverage Report for Build 2624102338

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • 303 unchanged lines in 7 files lost coverage.
  • Overall coverage decreased (-4.9%) to 74.137%

Changes Missing Coverage Covered Lines Changed/Added Lines %
ivadomed/loader/segmentation_pair.py 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
ivadomed/inference.py 3 78.09%
ivadomed/scripts/automate_training.py 7 83.4%
ivadomed/main.py 17 51.19%
ivadomed/testing.py 29 48.73%
ivadomed/postprocessing.py 35 53.19%
ivadomed/uncertainty.py 83 12.37%
ivadomed/evaluation.py 129 12.33%
Totals Coverage Status
Change from base Build 2605775728: -4.9%
Covered Lines: 4529
Relevant Lines: 6109

💛 - Coveralls

Copy link
Member

@dyt811 dyt811 left a comment

Choose a reason for hiding this comment

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

COOLIO!

@mariehbourget mariehbourget merged commit 3099fdf into master Jul 8, 2022
@mariehbourget mariehbourget deleted the mhb/fix-extension-error-message branch July 8, 2022 13:28
@mariehbourget mariehbourget added this to the new release milestone Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring PRs/Issues that solely deal with existing code reorganization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants