Skip to content

Conversation

@FabianHofmann
Copy link
Collaborator

Related to #550 #571

Changes proposed in this Pull Request

Establish a consistent coordinate alignment when linopy objects interact with DataArrays that have subset or superset coordinates

TODO:

  • extend test suit to linopy + linopy objects
  • manifest convention in the docs
  • clarify relation to linopy.align
  • really ensure convention holds true for all combinations of addition/multiplication/comparison + subset/superset` + order + object types
  • come up with a convention for equally shaped objects Fix coordinate misalignment in expression merge #550

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

Add le(), ge(), eq() methods to LinearExpression and Variable classes,
mirroring the pattern of add/sub/mul/div methods. These methods support
the join parameter for flexible coordinate alignment when creating constraints.
Consolidate repetitive alignment handling in _add_constant and
_apply_constant_op into a single _align_constant method. This
eliminates code duplication and makes the alignment behavior
(handling join parameter, fill_value, size-aware defaults) testable
and maintainable in one place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant