ITK
ITK copied to clipboard
BUG: Most ITK Python type hints do not show up in VS Code (Windows)
Description
https://github.com/InsightSoftwareConsortium/ITK/pull/3444 and its predecessors such as https://github.com/InsightSoftwareConsortium/ITK/pull/3200 were intended to introduce/improve type hints with the ITK Python package; however, only a subset of Pythonic type hints appear in VS Code using a pip-installed ITK package.
Steps to Reproduce
-
pip install itk
- Install VS Code with Python extensions, set Python interpreter
- Create a new Python file
import itk
itk.
- View list of suggestions after
itk.
in line 2
Expected behavior
Most/all values in itk
namespace are viewable in list. For instance, itk.Image
, itk.join_series_image_filter
Actual behavior
Only functions/types defined in https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/Python/itk/support/extras.py or https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/Python/itk/support/types.py appear to be represented in autocomplete suggestions
Reproducibility
Versions
ITK v5.3rc4, v5.3rc04.post1
Environment
Windows 10 VS Code 1.62
EDIT: Per @PranjalSahu 's comment below this issue is also observed in VSCode on Linux.
Additional Information
@PranjalSahu If you have a moment, could you please confirm whether you see a similar autocomplete list for ITK Python on Linux?
@tbirdso yes, I mostly see items from extras.py like you mentioned. And I didn't see itk.Image.
Thanks for verifying @PranjalSahu . Perhaps @hjmjohnson or @kian-weimer could weigh in on whether this issue was observed/anticipated from their testing surrounding #3200?
cc @thewtex
Have you tried 5.3rc4.post1
?
Hi @thewtex , good point, I just updated to 5.3rc04.post1
for my environment referenced by VS Code and am seeing the same behavior.