@@ -33,8 +33,9 @@ def __init__(self, start: TemporalDataUser, end: TemporalDataUser):
3333 self .has_time_dim = False
3434
3535 def transform_data (self , flow_system : 'FlowSystem' , name_prefix : str ):
36- self .start = flow_system .fit_to_model_coords (f'{ name_prefix } |start' , self .start , has_time_dim = self .has_time_dim )
37- self .end = flow_system .fit_to_model_coords (f'{ name_prefix } |end' , self .end , has_time_dim = self .has_time_dim )
36+ dims = None if self .has_time_dim else ['year' , 'scenario' ]
37+ self .start = flow_system .fit_to_model_coords (f'{ name_prefix } |start' , self .start , dims = dims )
38+ self .end = flow_system .fit_to_model_coords (f'{ name_prefix } |end' , self .end , dims = dims )
3839
3940
4041@register_class_for_io
@@ -189,33 +190,33 @@ def transform_data(self, flow_system: 'FlowSystem', name_prefix: str):
189190 label_prefix = name_prefix ,
190191 effect_values = self .fix_effects ,
191192 label_suffix = 'fix_effects' ,
192- has_time_dim = False ,
193+ dims = [ 'year' , 'scenario' ] ,
193194 )
194195 self .divest_effects = flow_system .fit_effects_to_model_coords (
195196 label_prefix = name_prefix ,
196197 effect_values = self .divest_effects ,
197198 label_suffix = 'divest_effects' ,
198- has_time_dim = False ,
199+ dims = [ 'year' , 'scenario' ] ,
199200 )
200201 self .specific_effects = flow_system .fit_effects_to_model_coords (
201202 label_prefix = name_prefix ,
202203 effect_values = self .specific_effects ,
203204 label_suffix = 'specific_effects' ,
204- has_time_dim = False ,
205+ dims = [ 'year' , 'scenario' ] ,
205206 )
206207 if self .piecewise_effects is not None :
207208 self .piecewise_effects .has_time_dim = False
208209 self .piecewise_effects .transform_data (flow_system , f'{ name_prefix } |PiecewiseEffects' )
209210
210211 self .minimum_size = flow_system .fit_to_model_coords (
211- f'{ name_prefix } |minimum_size' , self .minimum_size , has_time_dim = False
212+ f'{ name_prefix } |minimum_size' , self .minimum_size , dims = [ 'year' , 'scenario' ]
212213 )
213214 self .maximum_size = flow_system .fit_to_model_coords (
214- f'{ name_prefix } |maximum_size' , self .maximum_size , has_time_dim = False
215+ f'{ name_prefix } |maximum_size' , self .maximum_size , dims = [ 'year' , 'scenario' ]
215216 )
216217 if self .fixed_size is not None :
217218 self .fixed_size = flow_system .fit_to_model_coords (
218- f'{ name_prefix } |fixed_size' , self .fixed_size , has_time_dim = False
219+ f'{ name_prefix } |fixed_size' , self .fixed_size , dims = [ 'year' , 'scenario' ]
219220 )
220221
221222 def _plausibility_checks (self , flow_system ):
@@ -312,13 +313,13 @@ def transform_data(self, flow_system: 'FlowSystem', name_prefix: str):
312313 f'{ name_prefix } |consecutive_off_hours_max' , self .consecutive_off_hours_max
313314 )
314315 self .on_hours_total_max = flow_system .fit_to_model_coords (
315- f'{ name_prefix } |on_hours_total_max' , self .on_hours_total_max , has_time_dim = False
316+ f'{ name_prefix } |on_hours_total_max' , self .on_hours_total_max , dims = [ 'year' , 'scenario' ]
316317 )
317318 self .on_hours_total_min = flow_system .fit_to_model_coords (
318- f'{ name_prefix } |on_hours_total_min' , self .on_hours_total_min , has_time_dim = False
319+ f'{ name_prefix } |on_hours_total_min' , self .on_hours_total_min , dims = [ 'year' , 'scenario' ]
319320 )
320321 self .switch_on_total_max = flow_system .fit_to_model_coords (
321- f'{ name_prefix } |switch_on_total_max' , self .switch_on_total_max , has_time_dim = False
322+ f'{ name_prefix } |switch_on_total_max' , self .switch_on_total_max , dims = [ 'year' , 'scenario' ]
322323 )
323324
324325 @property
0 commit comments