PyPSA / linopy

Linear optimization with N-D labeled arrays in Python
https://linopy.readthedocs.io
MIT License
155 stars 43 forks source link

Annotate Typing #185

Closed FabianHofmann closed 3 weeks ago

FabianHofmann commented 9 months ago

It seems to be a good way to use monkeytype for this:

pip install monkeytype

monkeytype run -m pytest linopy --doctest-modules test 

monkeytype apply linopy.<module>

# see all modules with monkeytype list-modules

one needs to solve circular imports as well.

Afterwards we can add mypy to pre-commit

-   repo: https://github.com/pre-commit/mirrors-mypy
    rev: v1.6.1  # Use the sha / tag you want to point at
    hooks:
    -   id: mypy