Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Generate stub-files to support type hints
Wrapped Python classes and methods, have introspection enabled typehints to allow auto-completion in IDE's. Logic was added to the igenerator.py file to produce stubs for wrapped ITK classes in Python. A large number of available ITK classes are currently supported by this feature, with more being worked on. The itk-stubs directory is created with a __init__.pyi file that provides all the interface stubs to tools that can utilize stub files. The included interface files provide information needed for IDE's like Pycharm. Once built there should be no extra setup needed to get the hinting functionality. The hints for type selection factories use Template and Proxy names appended to them to differentiate them from the actual ITK classes. The interfaces may provide hints for types that are not valid in some cases. The interfaces suggest potentially correct input options. For example methods may only accept a double or character depending on the object type, but the hints will suggest both leaving it up to the user to determine which type is valid. NOTE: Stub files must use relative imports for .pyi files in order to expose the imported symbols. Co-authored-by: Kian Weimer <kianweimer@gmail.com>
- Loading branch information