Annotate several Model methods in the stubs#1220
Conversation
|
Awesome @jonathanberthias ! Can you also adapt the stub checker for this, to force new contributions to annotate as well? |
I'm not sure that's possible yet, I only annotated a tiny part of the API so we would need to "finish" everything before we can forbid broad annotations like ˋIncompleteˋ. BTW the automated script to generate stubs can't really be used anymore since it would remove all of these new annotations. We either need to make it smarter and not remove existing annotations, or rely on manual work for now. |
That is true, but perhaps we could have an intermediate script that just checks that no new stub errors are introduced. But maybe it's not worth the effort, yes. On the automated script: yeah, I should do another pass on it someday. Not this weekend, but perhaps the next. |
|
@Joao-Dionisio I think this is ready to merge in the current state, I prefer to tackle other topics in other PRs to avoid having too many merge conflicts. Let me know if you see anything wrong! |
|
@jonathanberthias alright, thank you very much! This week might be a bit busy, but I'll try to take a look over the weekend. |
|
Hey @jonathanberthias ! My claude flagged the following: Found 5 issues:
PySCIPOpt/src/pyscipopt/scip.pyi Lines 1127 to 1129 in 4814822
PySCIPOpt/src/pyscipopt/scip.pyi Lines 694 to 708 in 4814822
PySCIPOpt/src/pyscipopt/scip.pyi Lines 709 to 724 in 4814822
PySCIPOpt/src/pyscipopt/scip.pyi Lines 1492 to 1494 in 4814822
PySCIPOpt/src/pyscipopt/scip.pyi Lines 913 to 916 in 4814822 |
|
Thanks a lot for the review @Joao-Dionisio! I've fixed the findings, indeed I didn't integrate recent changes to the repo correctly, my bad 😅 |
|
Okay, I think this should be the last of them: Over-permissive parameters (
PySCIPOpt/src/pyscipopt/scip.pyi Lines 877 to 887 in 0486e4f
PySCIPOpt/src/pyscipopt/scip.pyi Lines 860 to 870 in 0486e4f
PySCIPOpt/src/pyscipopt/scip.pyi Lines 1216 to 1218 in 0486e4f Return type missing
PySCIPOpt/src/pyscipopt/scip.pyi Lines 1107 to 1108 in 0486e4f
PySCIPOpt/src/pyscipopt/scip.pyi Line 1110 in 0486e4f Parameter missing
PySCIPOpt/src/pyscipopt/scip.pyi Lines 1229 to 1232 in 0486e4f Wrong numeric return type (
PySCIPOpt/src/pyscipopt/scip.pyi Line 1102 in 0486e4f
PySCIPOpt/src/pyscipopt/scip.pyi Line 1294 in 0486e4f
PySCIPOpt/src/pyscipopt/scip.pyi Lines 1195 to 1196 in 0486e4f Return class too narrow:
PySCIPOpt/src/pyscipopt/scip.pyi Lines 817 to 831 in 0486e4f
PySCIPOpt/src/pyscipopt/scip.pyi Lines 844 to 859 in 0486e4f Spurious
PySCIPOpt/src/pyscipopt/scip.pyi Lines 1544 to 1550 in 0486e4f |
This is a first batch of annotations and default parameter values. I believe these are rather straightforward.
I ignored some annotations on purpose: anything related to
ExprConsbecause the annotations forExproperations aren't correct yet, and anything related to thePY_SCIP_*enums. These can be revisited at a later stage.Part of #1072