Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
- For the classes `Sink`, `Source` and `SourceAndSink`: `.sink`, `.source` and `.prevent_simultaneous_sink_and_source` are deprecated in favor of the new arguments `inputs`, `outputs` and `prevent_simultaneous_flow_rates`.

### Fixed
- Fixed testing issue with new `linopy` version 0.5.6 [[#296](https://github.com/PyPSA/linopy/pull/296) by [@FBumann](https://github.com/FBumann)]

## [2.1.5] - 2025-07-08

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies = [
"pandas >= 2.0.0, < 3",

# Optimization and data handling
"linopy >= 0.5.1, < 0.6.0",
"linopy >= 0.5.1, < 0.5.6", # Update and test regularly
"netcdf4 >= 1.6.1, < 2",

# Utilities
Expand Down
11 changes: 5 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,22 +450,21 @@ def basic_flow_system_linopy(timesteps_linopy) -> fx.FlowSystem:

def assert_conequal(actual: linopy.Constraint, desired: linopy.Constraint):
"""Assert that two constraints are equal with detailed error messages."""
name = actual.name

try:
linopy.testing.assert_linequal(actual.lhs, desired.lhs)
except AssertionError as e:
raise AssertionError(f"{name} left-hand sides don't match:\n{e}") from e
raise AssertionError(f"{actual.name} left-hand sides don't match:\n{e}") from e

try:
linopy.testing.assert_linequal(actual.rhs, desired.rhs)
xr.testing.assert_equal(actual.sign, desired.sign)
except AssertionError as e:
raise AssertionError(f"{name} right-hand sides don't match:\n{e}") from e
raise AssertionError(f"{actual.name} signs don't match:\n{e}") from e

try:
xr.testing.assert_equal(actual.sign, desired.sign)
xr.testing.assert_equal(actual.rhs, desired.rhs)
except AssertionError as e:
raise AssertionError(f"{name} signs don't match:\nActual: {actual.sign}\nExpected: {desired.sign}") from e
raise AssertionError(f"{actual.name} right-hand sides don't match:\n{e}") from e


def assert_var_equal(actual: linopy.Variable, desired: linopy.Variable):
Expand Down