Feature/example of drop=True #557
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #464
Changes proposed in this Pull Request
Add an example to the docs of
LinearExpression.where(..., drop=True)Add new properties to base expression
BaseExpression.variable_namesandBaseExpression.nvarNot addressed / further ideas
In the issue mentioned, I think the reporter wanted to see the unused terms in LinearExpression.repr. After having a bit of a look at it, I think this is impossible because the term dim has no coordinate names. There seems to no way to know what variable originally belonged in a position of the term dim if the original variable has been completely masked (replaced with -1).
Maybe when drop is True we could also run
.simplifyto get rid of any empty positions in the term dim?Currently
drop=Truewill drop unused index positions along all dimensions apart from the term dim, it might make more sense to drop on all dims?Checklist
doc.doc/release_notes.rstof the upcoming release is included.