Raise import error for openslide and cuimage#1699
Merged
bhashemian merged 2 commits intoProject-MONAI:masterfrom Mar 7, 2021
Merged
Raise import error for openslide and cuimage#1699bhashemian merged 2 commits intoProject-MONAI:masterfrom
bhashemian merged 2 commits intoProject-MONAI:masterfrom
Conversation
Signed-off-by: Behrooz <[email protected]>
Member
Author
|
/black |
Signed-off-by: Behrooz <[email protected]>
wyli
reviewed
Mar 5, 2021
| data: file name or a list of file names to read. | ||
|
|
||
| """ | ||
| if (self.reader_lib == "openslide") and (not has_osl): |
Contributor
There was a problem hiding this comment.
could have these logics even earlier for example between line 646 and 652?
Member
Author
There was a problem hiding this comment.
Actually no, Nic is instantiating this class in LoadImage, so the error shouldn't be raised in __init__ (it used to be raise without having has_osl and has_cux). The first place that it can be raised here.
I agree that the best place would be when the class is instantiating but for that purpose LoadImage need to be changed:
MONAI/monai/transforms/io/array.py
Line 93 in 6bc94b5
Contributor
There was a problem hiding this comment.
sure you're right!
(@Nic-Ma I'm approving this for now, perhaps we need another iteration to revise the base API?)
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.
Description
In order for WSIReader to be used in LoadImage, optional import error in the
__init__ofWSIReaderwas skipped, so a secondary exception was raised instead, which is not informative and does not help the user to know the cause. This PR fixes this issue by raising the appropriate import error whenWSIReader.readis being called.Status
Ready
Types of changes
./runtests.sh --codeformat --coverage../runtests.sh --quick.make htmlcommand in thedocs/folder.