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

Type annotations #1109

Open
effigies opened this issue May 17, 2022 · 4 comments
Open

Type annotations #1109

effigies opened this issue May 17, 2022 · 4 comments

Comments

@effigies
Copy link
Member

We should add type annotations, particularly to such heavily-used functions and properties as DataobjImage.get_fdata(), SpatialImage.affine. This will make it easier on users working in environments that provide type hints and autocompletion.

@effigies
Copy link
Member Author

effigies commented May 18, 2022

@effigies
Copy link
Member Author

effigies commented Jun 7, 2022

Mypy seems to be the way to get moving with type annotations. They've got some docs for Using mypy with an existing codebase.

@mgxd
Copy link
Member

mgxd commented Jun 10, 2022

Here's a talk that is relevant: https://www.youtube.com/watch?v=wbohVjhqg7c

@mgxd
Copy link
Member

mgxd commented Aug 9, 2022

Just writing down a thought I had:

I wasn't sure whether to use nibabel.filebasedimages.FileBasedImage or nibabel.spatialimages.SpatialImage as a general base for an image I want to load(). Perhaps there should be a nibabel.types module with some common types / basic information to help annotate code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants