AcademySoftwareFoundation / openexr

The OpenEXR project provides the specification and reference implementation of the EXR file format, the professional-grade image storage format of the motion picture industry.
http://www.openexr.com/
BSD 3-Clause "New" or "Revised" License
1.6k stars 606 forks source link

OpenEXR - Python IntelliSense #1607

Open 404Vector opened 6 months ago

404Vector commented 6 months ago

OpenEXR - Python does not allow code autocompletion using intellisense. is

intellisense is a simple convenience feature.

However, I hope that the openexr-python package will be supported to enable intellisense so that many developers can easily access it in the future.

meshula commented 6 months ago

Do you know why Intellisense can't autocomplete on OpenEXR? It sounds like a good thing to support if it doesn't require special maintenance. I don't know if anyone on the team has experience with Python and Intellisense.

404Vector commented 6 months ago

My guess is that the file does not exist in *.py format.

For Imath it exists as Imath.py, but for OpenEXR it does not. c

I created a simple python wrapper to solve this problem. I hope this project helps you in your decision making. (https://github.com/404Vector/OpenEXR-Python?tab=readme-ov-file)

Although I haven't done much testing, I confirmed that it works well within the range I need (reading and writing files, extracting metadata, and intellisense support). d

I don't know if this is the best way to support intellisense (there may be a way to expose it automatically).

However, I think OpenEXR is a very stable project. And the number of interfaces exposed in the Python runtime environment is small. Therefore, I think this method will also be easy to maintain.

meshula commented 6 months ago

Your solution does look easy to maintain, thanks for putting it together.

I'm not a Python expert, so please forgive my basic questions.

404Vector commented 5 months ago
meshula commented 5 months ago

Thanks @404Vector !

@reinecke is there any guidance from the OpenTimelineIO project on this? I think OTIO went through a couple of iterations to get this working across the board.

Parskatt commented 4 weeks ago

@meshula @404Vector One way to solve this is to use .pyi files which is basically declaring the python interface of your cpython methods. This will make intellisense be able to see expected inputs/outputs, but code will still be executed through the .so module and not via any wrapper.

Also thanks @404Vector for the wrapper.