Python CP-SAT type hints · Pull Request #3668 · google/or-tools

@ghost

Work in progress, opened as draft pull request.

Tasks:

  • Custom types: Integral (same logic as cmh.is_integral), Literal (IntVar+_NotBooleanVariable+Integral), Arc, etc
  • Run mypy on ortools/sat/samples

oulianov

oulianov

oulianov

oulianov

@oulianov

Thank you for opening this review ! That's a great start.

I added some comments right now with additional typing from the top of my mind. But there are many more missing, even in other files 🤔

What would be the best way to help you cover all the definitions ?

@ghost

Thanks for the help offer and suggestions! @oulianov

But I believe I just need some time to figure out the best type definitions for some of the more complex interfaces, eg:

  • OnlyEnforceIf
  • arcs (iterable of sequence of len 3)
  • etc

And test them thoroughly.

@oulianov

For sure, totally understand. Wish you the best, feel free to reach out

@ghost ghost marked this pull request as ready for review

February 13, 2023 22:43

@ghost ghost marked this pull request as draft

February 25, 2023 00:28

@ghost ghost marked this pull request as ready for review

March 7, 2023 22:01

@lperron

Hi,

Any change of pushing this ?
Just run the black formatter on the code before committing.

@stradivari96

@ghost

My bad, never saw the conflicts, should be ready to review/merge now