From 8c5efb5252ec6da029e2ad9178ce019d1ed2dec1 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Mon, 20 Jul 2020 17:33:15 +0200 Subject: [PATCH] add compatibility with pyomo 5.7.0 (#172) * add compatibility with pyomo 5.7.0 * add release notes [skip travis] --- doc/release_notes.rst | 1 + environment.docs.yaml | 2 +- environment.yaml | 2 +- scripts/cluster_network.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 3e8ed2f7..5b1258b7 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -13,6 +13,7 @@ Upcoming Release * Added an option to alter the capital cost of carriers by a factor via ``carrier+factor`` in the ``{opts}`` wildcard. This can be useful for exploring uncertain cost parameters. Example: ``solar+0.5`` reduces the capital cost of solar to 50% of original values (`#167 `_). +* Add compatibility for pyomo 5.7.0 in :mod:`cluster_network` and :mod:`simplify_network`. PyPSA-Eur 0.2.0 (8th June 2020) ================================== diff --git a/environment.docs.yaml b/environment.docs.yaml index b345bf62..3c50f2f2 100755 --- a/environment.docs.yaml +++ b/environment.docs.yaml @@ -9,7 +9,7 @@ channels: dependencies: #- python - pip - - pypsa>=0.17 + - pypsa>=0.17.1 - atlite=0.0.3 # Dependencies of the workflow itself diff --git a/environment.yaml b/environment.yaml index e30e0b9a..ce49420f 100644 --- a/environment.yaml +++ b/environment.yaml @@ -12,7 +12,7 @@ dependencies: - python - pip - - pypsa>=0.17 + - pypsa>=0.17.1 - atlite=0.0.3 # Dependencies of the workflow itself diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index c5ce98e0..ff85bcf3 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -221,7 +221,7 @@ def distribute_clusters(n, n_clusters, focus_weights=None, solver_name=None): opt = po.SolverFactory('ipopt') results = opt.solve(m) - assert results['Solver'][0]['Status'].key == 'ok', "Solver returned non-optimally: {}".format(results) + assert results['Solver'][0]['Status'] == 'ok', "Solver returned non-optimally: {}".format(results) return pd.Series(m.n.get_values(), index=L.index).astype(int)