@@ -143,29 +143,9 @@ def next(self, mca_market: Dataset) -> Dataset:
143143 consumption = self ._interpolate (presets .consumption , mca_market .year )
144144 costs = self ._interpolate (presets .costs , mca_market .year )
145145
146- result = Dataset ({"supply" : supply , "consumption" : consumption })
147- result ["costs" ] = drop_timeslice (costs )
146+ result = Dataset ({"supply" : supply , "consumption" : consumption , "costs" : costs })
148147 assert isinstance (result , Dataset )
149148 return result
150149
151150 def _interpolate (self , data : DataArray , years : DataArray ) -> DataArray :
152- """Chooses interpolation depending on whether forecast is available."""
153- if "forecast" in data .dims :
154- baseyear = int (years .min ())
155- forecasted = (years - baseyear ).values
156- result = (
157- data .interp (
158- year = baseyear ,
159- method = self .interpolation_mode ,
160- kwargs = {"fill_value" : "extrapolate" },
161- )
162- .interp (
163- forecast = forecasted ,
164- method = self .interpolation_mode ,
165- kwargs = {"fill_value" : "extrapolate" },
166- )
167- .drop_vars (("year" , "forecast" ))
168- )
169- result ["year" ] = "forecast" , years .values
170- return result .set_index (forecast = "year" ).rename (forecast = "year" )
171151 return data .interp (year = years , method = self .interpolation_mode ).ffill ("year" )
0 commit comments