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. |
|
well, I just took python 3.8 out because gurobipy did and just makes testing more complicated. |
|
I have been thinking about this and I think it would be best to split this up into different PRs:
|
|
hello! Should we close this PR? I think most of the hints are there, and the rest can be addressed as part of the regular changes to the repo. Thanks for all your help @MBradbury |
|
Yes we should, just two things to get out of it before closing:
Other issues still need to be looked at, but may be better as individual issues:
|
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 inLpAffineExpressionthat assume that all the items it contains are either aLpVariableor aLpConstraintVar. Several options:LpConstraintVarinherit fromLpVariable?LpConstraintVarseparately?LpConstraintVarsupport operators in aLpAffineExpression?FractionElasticSubProblemas 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.