From 53cd16785d357847bc154ecacb7d642208002672 Mon Sep 17 00:00:00 2001 From: Tom Bland Date: Thu, 4 Jul 2024 21:11:27 +0100 Subject: [PATCH 1/2] Add reset_index --- src/muse/investments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/muse/investments.py b/src/muse/investments.py index 9c40ef199..a42fd543d 100644 --- a/src/muse/investments.py +++ b/src/muse/investments.py @@ -310,7 +310,7 @@ def scipy_match_demand( from muse.constraints import ScipyAdapter - df_technologies = technologies.to_dataframe() + df_technologies = technologies.to_dataframe().reset_index() if "timeslice" in costs.dims and timeslice_op is not None: costs = timeslice_op(costs) From ebb816a4fca22ece3f3f512b90e8311ff8263b44 Mon Sep 17 00:00:00 2001 From: Tom Bland Date: Fri, 5 Jul 2024 09:15:49 +0100 Subject: [PATCH 2/2] Second attempt to fix error message --- src/muse/investments.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/muse/investments.py b/src/muse/investments.py index a42fd543d..7d92e5c7b 100644 --- a/src/muse/investments.py +++ b/src/muse/investments.py @@ -310,8 +310,6 @@ def scipy_match_demand( from muse.constraints import ScipyAdapter - df_technologies = technologies.to_dataframe().reset_index() - if "timeslice" in costs.dims and timeslice_op is not None: costs = timeslice_op(costs) if "year" in technologies.dims and year is None: @@ -342,7 +340,7 @@ def scipy_match_demand( msg = ( res.message + "\n" - + f"Error in sector containing {df_technologies.technology.unique()}" + + f"Error in sector containing {technologies.technology.values}" ) getLogger(__name__).critical(msg) raise GrowthOfCapacityTooConstrained