ITK icon indicating copy to clipboard operation
ITK copied to clipboard

BUG: Most ITK Python type hints do not show up in VS Code (Windows)

Open tbirdso opened this issue 1 year ago • 5 comments

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

  1. pip install itk
  2. Install VS Code with Python extensions, set Python interpreter
  3. Create a new Python file
import itk
itk.
  1. 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

tbirdso avatar Jul 14 '22 20:07 tbirdso

@PranjalSahu If you have a moment, could you please confirm whether you see a similar autocomplete list for ITK Python on Linux?

tbirdso avatar Jul 14 '22 20:07 tbirdso

@tbirdso yes, I mostly see items from extras.py like you mentioned. And I didn't see itk.Image. Screenshot from 2022-07-14 16-17-21

PranjalSahu avatar Jul 14 '22 20:07 PranjalSahu

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

tbirdso avatar Jul 14 '22 20:07 tbirdso

Have you tried 5.3rc4.post1?

thewtex avatar Jul 22 '22 18:07 thewtex

Hi @thewtex , good point, I just updated to 5.3rc04.post1 for my environment referenced by VS Code and am seeing the same behavior.

tbirdso avatar Jul 22 '22 19:07 tbirdso