-
Notifications
You must be signed in to change notification settings - Fork 258
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
Type checking issues #1252
Comments
Just saw this comment #1109 (comment). I think this change to |
Have you seen #1220 (comment)? |
Ah. I had not. Good resource. I was wondering if that would have to be the case. It honestly is smarter code anyways, even if it is more verbose. |
I'm a bit surprised by this. We haven't typed the |
This is in my IDE. I use PyCharm from JetBrains. The error I get is |
Ah, I bet it's picking up on the nibabel/nibabel/spatialimages.py Lines 481 to 488 in 1843355
|
Is that as easy of a PR as I think? I can submit fix, if so. |
I think it should be, yes. Please go ahead. |
#1253 is open. Closing this issue as both concerns have been addressed. |
Hi Nibabel community,
Great job on getting some type checking into this package! I wanted to point out two scenarios that I use frequently that have run me into type checking issues based on 5.1.0.
nb.load
shows a return type ofFileBasedImage
. This is all well and good, but unfortunatelyFileBasedImage
does not defineget_fdata()
. A common code example that I use (and see around) is:nb.Nifti1Image
doesn't want to takeNone
for the affine. I previously saw this code used frequently:Just bringing these to your attention. I'm also flexible to change up my code, if better patterns are recommended.
The text was updated successfully, but these errors were encountered: