1616import numpy as np
1717import xarray as xr
1818
19+ from .config import DEPRECATION_REMOVAL_VERSION
1920from .core import PlausibilityError
2021from .features import ShareAllocationModel
2122from .structure import Element , ElementContainer , ElementModel , FlowSystemModel , Submodel , register_class_for_io
@@ -251,7 +252,8 @@ def __init__(
251252 def minimum_operation (self ):
252253 """DEPRECATED: Use 'minimum_temporal' property instead."""
253254 warnings .warn (
254- "Property 'minimum_operation' is deprecated. Use 'minimum_temporal' instead." ,
255+ f"Property 'minimum_operation' is deprecated. Use 'minimum_temporal' instead. "
256+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
255257 DeprecationWarning ,
256258 stacklevel = 2 ,
257259 )
@@ -261,7 +263,8 @@ def minimum_operation(self):
261263 def minimum_operation (self , value ):
262264 """DEPRECATED: Use 'minimum_temporal' property instead."""
263265 warnings .warn (
264- "Property 'minimum_operation' is deprecated. Use 'minimum_temporal' instead." ,
266+ f"Property 'minimum_operation' is deprecated. Use 'minimum_temporal' instead. "
267+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
265268 DeprecationWarning ,
266269 stacklevel = 2 ,
267270 )
@@ -271,7 +274,8 @@ def minimum_operation(self, value):
271274 def maximum_operation (self ):
272275 """DEPRECATED: Use 'maximum_temporal' property instead."""
273276 warnings .warn (
274- "Property 'maximum_operation' is deprecated. Use 'maximum_temporal' instead." ,
277+ f"Property 'maximum_operation' is deprecated. Use 'maximum_temporal' instead. "
278+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
275279 DeprecationWarning ,
276280 stacklevel = 2 ,
277281 )
@@ -281,7 +285,8 @@ def maximum_operation(self):
281285 def maximum_operation (self , value ):
282286 """DEPRECATED: Use 'maximum_temporal' property instead."""
283287 warnings .warn (
284- "Property 'maximum_operation' is deprecated. Use 'maximum_temporal' instead." ,
288+ f"Property 'maximum_operation' is deprecated. Use 'maximum_temporal' instead. "
289+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
285290 DeprecationWarning ,
286291 stacklevel = 2 ,
287292 )
@@ -291,7 +296,8 @@ def maximum_operation(self, value):
291296 def minimum_invest (self ):
292297 """DEPRECATED: Use 'minimum_periodic' property instead."""
293298 warnings .warn (
294- "Property 'minimum_invest' is deprecated. Use 'minimum_periodic' instead." ,
299+ f"Property 'minimum_invest' is deprecated. Use 'minimum_periodic' instead. "
300+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
295301 DeprecationWarning ,
296302 stacklevel = 2 ,
297303 )
@@ -301,7 +307,8 @@ def minimum_invest(self):
301307 def minimum_invest (self , value ):
302308 """DEPRECATED: Use 'minimum_periodic' property instead."""
303309 warnings .warn (
304- "Property 'minimum_invest' is deprecated. Use 'minimum_periodic' instead." ,
310+ f"Property 'minimum_invest' is deprecated. Use 'minimum_periodic' instead. "
311+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
305312 DeprecationWarning ,
306313 stacklevel = 2 ,
307314 )
@@ -311,7 +318,8 @@ def minimum_invest(self, value):
311318 def maximum_invest (self ):
312319 """DEPRECATED: Use 'maximum_periodic' property instead."""
313320 warnings .warn (
314- "Property 'maximum_invest' is deprecated. Use 'maximum_periodic' instead." ,
321+ f"Property 'maximum_invest' is deprecated. Use 'maximum_periodic' instead. "
322+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
315323 DeprecationWarning ,
316324 stacklevel = 2 ,
317325 )
@@ -321,7 +329,8 @@ def maximum_invest(self):
321329 def maximum_invest (self , value ):
322330 """DEPRECATED: Use 'maximum_periodic' property instead."""
323331 warnings .warn (
324- "Property 'maximum_invest' is deprecated. Use 'maximum_periodic' instead." ,
332+ f"Property 'maximum_invest' is deprecated. Use 'maximum_periodic' instead. "
333+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
325334 DeprecationWarning ,
326335 stacklevel = 2 ,
327336 )
@@ -331,7 +340,8 @@ def maximum_invest(self, value):
331340 def minimum_operation_per_hour (self ):
332341 """DEPRECATED: Use 'minimum_per_hour' property instead."""
333342 warnings .warn (
334- "Property 'minimum_operation_per_hour' is deprecated. Use 'minimum_per_hour' instead." ,
343+ f"Property 'minimum_operation_per_hour' is deprecated. Use 'minimum_per_hour' instead. "
344+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
335345 DeprecationWarning ,
336346 stacklevel = 2 ,
337347 )
@@ -341,7 +351,8 @@ def minimum_operation_per_hour(self):
341351 def minimum_operation_per_hour (self , value ):
342352 """DEPRECATED: Use 'minimum_per_hour' property instead."""
343353 warnings .warn (
344- "Property 'minimum_operation_per_hour' is deprecated. Use 'minimum_per_hour' instead." ,
354+ f"Property 'minimum_operation_per_hour' is deprecated. Use 'minimum_per_hour' instead. "
355+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
345356 DeprecationWarning ,
346357 stacklevel = 2 ,
347358 )
@@ -351,7 +362,8 @@ def minimum_operation_per_hour(self, value):
351362 def maximum_operation_per_hour (self ):
352363 """DEPRECATED: Use 'maximum_per_hour' property instead."""
353364 warnings .warn (
354- "Property 'maximum_operation_per_hour' is deprecated. Use 'maximum_per_hour' instead." ,
365+ f"Property 'maximum_operation_per_hour' is deprecated. Use 'maximum_per_hour' instead. "
366+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
355367 DeprecationWarning ,
356368 stacklevel = 2 ,
357369 )
@@ -361,7 +373,8 @@ def maximum_operation_per_hour(self):
361373 def maximum_operation_per_hour (self , value ):
362374 """DEPRECATED: Use 'maximum_per_hour' property instead."""
363375 warnings .warn (
364- "Property 'maximum_operation_per_hour' is deprecated. Use 'maximum_per_hour' instead." ,
376+ f"Property 'maximum_operation_per_hour' is deprecated. Use 'maximum_per_hour' instead. "
377+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
365378 DeprecationWarning ,
366379 stacklevel = 2 ,
367380 )
@@ -371,7 +384,8 @@ def maximum_operation_per_hour(self, value):
371384 def minimum_total_per_period (self ):
372385 """DEPRECATED: Use 'minimum_total' property instead."""
373386 warnings .warn (
374- "Property 'minimum_total_per_period' is deprecated. Use 'minimum_total' instead." ,
387+ f"Property 'minimum_total_per_period' is deprecated. Use 'minimum_total' instead. "
388+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
375389 DeprecationWarning ,
376390 stacklevel = 2 ,
377391 )
@@ -381,7 +395,8 @@ def minimum_total_per_period(self):
381395 def minimum_total_per_period (self , value ):
382396 """DEPRECATED: Use 'minimum_total' property instead."""
383397 warnings .warn (
384- "Property 'minimum_total_per_period' is deprecated. Use 'minimum_total' instead." ,
398+ f"Property 'minimum_total_per_period' is deprecated. Use 'minimum_total' instead. "
399+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
385400 DeprecationWarning ,
386401 stacklevel = 2 ,
387402 )
@@ -391,7 +406,8 @@ def minimum_total_per_period(self, value):
391406 def maximum_total_per_period (self ):
392407 """DEPRECATED: Use 'maximum_total' property instead."""
393408 warnings .warn (
394- "Property 'maximum_total_per_period' is deprecated. Use 'maximum_total' instead." ,
409+ f"Property 'maximum_total_per_period' is deprecated. Use 'maximum_total' instead. "
410+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
395411 DeprecationWarning ,
396412 stacklevel = 2 ,
397413 )
@@ -401,7 +417,8 @@ def maximum_total_per_period(self):
401417 def maximum_total_per_period (self , value ):
402418 """DEPRECATED: Use 'maximum_total' property instead."""
403419 warnings .warn (
404- "Property 'maximum_total_per_period' is deprecated. Use 'maximum_total' instead." ,
420+ f"Property 'maximum_total_per_period' is deprecated. Use 'maximum_total' instead. "
421+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
405422 DeprecationWarning ,
406423 stacklevel = 2 ,
407424 )
@@ -616,7 +633,8 @@ def get_effect_label(eff: Effect | str) -> str:
616633 if isinstance (eff , Effect ):
617634 warnings .warn (
618635 f'The use of effect objects when specifying EffectValues is deprecated. '
619- f'Use the label of the effect instead. Used effect: { eff .label_full } ' ,
636+ f'Use the label of the effect instead. Used effect: { eff .label_full } . '
637+ f'Will be removed in v{ DEPRECATION_REMOVAL_VERSION } .' ,
620638 UserWarning ,
621639 stacklevel = 2 ,
622640 )
0 commit comments