diff --git a/CHANGELOG.md b/CHANGELOG.md index 6232a61f7..f689f5121 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 8c846dc03..4624d3a00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 diff --git a/tests/conftest.py b/tests/conftest.py index 5399be72a..c8d2e5606 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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):