-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Type hints #807
base: master
Are you sure you want to change the base?
Type hints #807
Conversation
Thanks, I will happy contribute to this initiative of adding types. I have no problem moving to 3.9, although if it's only to avoid writing Many of your questions are for @stumitchell to answer, I believe.
|
Amazing work, thank you! I can also help with reviewing and changes if needed, although currently a bit busy. Regarding python 3.8, it's already end-of-lifecycle, so I don't see a reason not to move away from it, people shouldn't be using it anyway. |
For dacite, alternatively, pulp moves to pickle for disk serialisation which would eliminate the need for dacite, but then human-readability of the files would be lost. The type hints do not prevent dicts / matrix being used with more dimensions, just means that IDEs won't provide accurate information on the returned type. |
I have seen #755 and wanted to take a look at providing type hints also. I would appreciate a review of this, as there are some choices I made which need to be checked and others where a decision needs to be made.
Summary:
list[T]
was introduced (instead of usingList[T]
)Choices to make:
LpConstraintVar
? Is it a variable or is it a constraint? There are several pieces of code inLpAffineExpression
that assume that all the items it contains are either aLpVariable
or aLpConstraintVar
. Several options:LpConstraintVar
inherit fromLpVariable
?LpConstraintVar
separately?LpConstraintVar
support operators in aLpAffineExpression
?FractionElasticSubProblem
as parameters seemed to be in the incorrect order for the__init__
.There is also a test failure to investigate (PULP_CBC_CMDTest.test_dual_variables_reduced_costs), but I am having trouble finding the root cause.