Skip to content

Annotate typing #310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
628a79d
add type annotations through monkeytype
FabianHofmann May 12, 2024
a240ef8
follow up
FabianHofmann May 13, 2024
551baf1
add mypy to pre-commit
FabianHofmann May 13, 2024
4e0df30
some futher typing changes
FabianHofmann Jun 17, 2024
6897642
follow up
FabianHofmann Jun 17, 2024
2951a6a
follow up
FabianHofmann Jun 17, 2024
d57223f
follow up
FabianHofmann Jun 18, 2024
82b5769
typing: finish common.py
FabianHofmann Jun 19, 2024
434cd62
follow up
FabianHofmann Jun 19, 2024
8df164c
add types module
FabianHofmann Jun 22, 2024
d29dc85
follow up
FabianHofmann Jun 24, 2024
dd6fc46
follow up
FabianHofmann Jun 25, 2024
7d6fa44
follow up
FabianHofmann Jun 25, 2024
3370599
succesfully run mypy!
FabianHofmann Jun 27, 2024
ec50bdc
model: ensure str to path in solve function
FabianHofmann Jun 27, 2024
4d9bd35
follow up from bad git rebase
FabianHofmann Jun 27, 2024
75e0c3b
solvers: fix file path to string
FabianHofmann Jun 27, 2024
93c372b
types: adjust for python 3.9 types
FabianHofmann Jun 27, 2024
4daee54
pre-commit: remove scipy from mypy-mirror deps
FabianHofmann Jun 27, 2024
41b9d3e
follow up
FabianHofmann Jun 27, 2024
8d383b9
pre-commit: exclude benchmark leftovers from mypy
FabianHofmann Jun 27, 2024
a70342e
fix pre-commit mypy args
FabianHofmann Jun 27, 2024
201b164
ci: fix mypy pre-commit
lkstrp Jun 28, 2024
868e90b
increase test coverage
FabianHofmann Jul 1, 2024
5949eca
Merge branch 'master' into annotate-typing
FabianHofmann Jul 1, 2024
b255d97
add release notes
FabianHofmann Jul 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ doc/api
.vscode
Highs.log
paper/
monkeytype.sqlite3


benchmark/*.pdf
benchmark/benchmarks
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ repos:
hooks:
- id: jupyter-notebook-cleanup
exclude: examples/solve-on-remote.ipynb
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
hooks:
- id: mypy
files: ^(linopy|test)/
additional_dependencies: [numpy, pandas, xarray, types-paramiko]
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Release Notes
Upcoming Version
----------------

* Linopy now uses mypy for type checking allowing for a more secure and stable code base.


Version 0.3.11
--------------
Expand Down
2 changes: 1 addition & 1 deletion linopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Note: For intercepting multiplications between xarray dataarrays, Variables and Expressions
# we need to extend their __mul__ functions with a quick special case
import linopy.monkey_patch_xarray
from linopy import model, remote
from linopy import model, remote, types
from linopy.config import options
from linopy.constants import EQUAL, GREATER_EQUAL, LESS_EQUAL
from linopy.constraints import Constraint
Expand Down
Loading
Loading