esa / pygmo2

A Python platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pygmo2/
Mozilla Public License 2.0
414 stars 56 forks source link

Support for IDE python type hinting and autocompletion #154

Open npetersen2 opened 4 months ago

npetersen2 commented 4 months ago

Pygmo is working great for my application. However, it is time-consuming to implement new application code due to lack of type hinting in python from the core pygmo library.

For example, when computing the pareto front:

There is no IDE support to help accelerate code time.

However, the docs page clearly states exactly what is expected as input and output from this function:

Describe the solution you'd like Python type hinting and help docstrings have become very popular. It would be nice to have this built into pygmo so the IDE (VSCode in my case) can easily show helpful information.

For example, when I use the pandas library, it gives wonderful IDE hints:

When I browse the pygmo code files, it seems the issue is the core library functions are written in C and imported from the .pyd file, so the Python IDE support has no way of seeing the available functions, except during runtime.

Is there a way to wrap the functions in core.pyd to enable type hinting and IDE code support?