-
Notifications
You must be signed in to change notification settings - Fork 60
Fixed typing of arithmetic methods #454
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
base: master
Are you sure you want to change the base?
Fixed typing of arithmetic methods #454
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @RobbieKiwi, that was annoying. Could you also add the missing lines to the test and resolve the other mypy warnings?
Is there a reason why one of these should work and the other should give a type error? |
for more information, see https://pre-commit.ci
…m:RobbieKiwi/linopy into feature/variable_and_data_array_operators
@lkstrp I went down a bit of a rabbit hole with the typing in order to make sure the type checker could tell the difference between a LinearExpression and QuadraticExpression which involved breaking the inheritance between the two and making a base class. Could you please have another look? |
impressive work @RobbieKiwi ! @lkstrp or I will go through it soon! we'll make another release today but this will definitely go into the next one! |
Closes #435.
Changes proposed in this Pull Request
Arithmetic methods now understand that data array is a valid type for addition/multiplication
Checklist
doc
.doc/release_notes.rst
of the upcoming release is included.