Skip to content

Amplpy have type hint suport? (Types Stub) #61

@davi-lucciola

Description

@davi-lucciola

Hi, I am a beginner with AMPL and I decided to learn amplpy because I have more experience with Python.
I installed the amplpy library following the official guide (https://amplpy.ampl.com/en/latest/getting-started.html) with the "highs" solver and implemented a simple example:

Image

It is working, but I noticed that VS Code (Pylance) is not recognizing the amplpy types correctly. I suppose this is because the "ampl" submodule in "amplpy" is built in C++/Cython. Am I missing something? I am using Python 3.12.

Image

I am not sure if I am doing something wrong, but if not, does amplpy provide an official type stub library for type hints? Or is there another way to get type information from the documentation, etc.?

I know this is not really an issue, but thanks in advance!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions