mrc-ide / frogger

https://mrc-ide.github.io/frogger/
Other
0 stars 1 forks source link

Create mypy stubs from pybind11 types #58

Open r-ash opened 3 months ago

r-ash commented 3 months ago

At the moment the python code is getting a lint error when because types Demography, State etc. are not know. Can we generate stubs for these? https://mypy.readthedocs.io/en/stable/stubgen.html

r-ash commented 3 months ago

I tried 2 different approaches to this, stubgen which is built into mypy and pybind11-stubgen. I could run stubgen using stubgen -m leapfrog -p . but the produced stubs had many lint issues in them themselves. I couldn't get pybind11-stubgen to run.

I think it is worth looking into this a bit more deeply but not super pressing at the moment, I've just ignored the mypy errors where we are importing types from the leapfrog C++ code.