@@ -101,11 +101,11 @@ def test_effects_per_flow_hour(self, basic_flow_system_linopy):
101101 co2_per_flow_hour = xr .DataArray (np .linspace (4 , 5 , timesteps .size ), coords = (timesteps ,))
102102
103103 flow = fx .Flow (
104- 'Wärme' , bus = 'Fernwärme' , effects_per_flow_hour = {'Costs ' : costs_per_flow_hour , 'CO2' : co2_per_flow_hour }
104+ 'Wärme' , bus = 'Fernwärme' , effects_per_flow_hour = {'costs ' : costs_per_flow_hour , 'CO2' : co2_per_flow_hour }
105105 )
106106 flow_system .add_elements (fx .Sink ('Sink' , sink = flow ), fx .Effect ('CO2' , 't' , '' ))
107107 model = create_linopy_model (flow_system )
108- costs , co2 = flow_system .effects ['Costs ' ], flow_system .effects ['CO2' ]
108+ costs , co2 = flow_system .effects ['costs ' ], flow_system .effects ['CO2' ]
109109
110110 assert_sets_equal (
111111 set (flow .submodel .variables ),
@@ -114,12 +114,12 @@ def test_effects_per_flow_hour(self, basic_flow_system_linopy):
114114 )
115115 assert_sets_equal (set (flow .submodel .constraints ), {'Sink(Wärme)|total_flow_hours' }, msg = 'Incorrect constraints' )
116116
117- assert 'Sink(Wärme)->Costs (operation)' in set (costs .submodel .constraints )
117+ assert 'Sink(Wärme)->costs (operation)' in set (costs .submodel .constraints )
118118 assert 'Sink(Wärme)->CO2(operation)' in set (co2 .submodel .constraints )
119119
120120 assert_conequal (
121- model .constraints ['Sink(Wärme)->Costs (operation)' ],
122- model .variables ['Sink(Wärme)->Costs (operation)' ]
121+ model .constraints ['Sink(Wärme)->costs (operation)' ],
122+ model .variables ['Sink(Wärme)->costs (operation)' ]
123123 == flow .submodel .variables ['Sink(Wärme)|flow_rate' ] * model .hours_per_step * costs_per_flow_hour ,
124124 )
125125
@@ -426,22 +426,22 @@ def test_flow_invest_with_effects(self, basic_flow_system_linopy):
426426 minimum_size = 20 ,
427427 maximum_size = 100 ,
428428 optional = True ,
429- fix_effects = {'Costs ' : 1000 , 'CO2' : 5 }, # Fixed investment effects
430- specific_effects = {'Costs ' : 500 , 'CO2' : 0.1 }, # Specific investment effects
429+ fix_effects = {'costs ' : 1000 , 'CO2' : 5 }, # Fixed investment effects
430+ specific_effects = {'costs ' : 500 , 'CO2' : 0.1 }, # Specific investment effects
431431 ),
432432 )
433433
434434 flow_system .add_elements (fx .Sink ('Sink' , sink = flow ), co2 )
435435 model = create_linopy_model (flow_system )
436436
437437 # Check investment effects
438- assert 'Sink(Wärme)->Costs (invest)' in model .variables
438+ assert 'Sink(Wärme)->costs (invest)' in model .variables
439439 assert 'Sink(Wärme)->CO2(invest)' in model .variables
440440
441441 # Check fix effects (applied only when is_invested=1)
442442 assert_conequal (
443- model .constraints ['Sink(Wärme)->Costs (invest)' ],
444- model .variables ['Sink(Wärme)->Costs (invest)' ]
443+ model .constraints ['Sink(Wärme)->costs (invest)' ],
444+ model .variables ['Sink(Wärme)->costs (invest)' ]
445445 == flow .submodel .variables ['Sink(Wärme)|is_invested' ] * 1000
446446 + flow .submodel .variables ['Sink(Wärme)|size' ] * 500 ,
447447 )
@@ -464,19 +464,19 @@ def test_flow_invest_divest_effects(self, basic_flow_system_linopy):
464464 minimum_size = 20 ,
465465 maximum_size = 100 ,
466466 optional = True ,
467- divest_effects = {'Costs ' : 500 }, # Cost incurred when NOT investing
467+ divest_effects = {'costs ' : 500 }, # Cost incurred when NOT investing
468468 ),
469469 )
470470
471471 flow_system .add_elements (fx .Sink ('Sink' , sink = flow ))
472472 model = create_linopy_model (flow_system )
473473
474474 # Check divestment effects
475- assert 'Sink(Wärme)->Costs (invest)' in model .constraints
475+ assert 'Sink(Wärme)->costs (invest)' in model .constraints
476476
477477 assert_conequal (
478- model .constraints ['Sink(Wärme)->Costs (invest)' ],
479- model .variables ['Sink(Wärme)->Costs (invest)' ] + (model .variables ['Sink(Wärme)|is_invested' ] - 1 ) * 500 == 0 ,
478+ model .constraints ['Sink(Wärme)->costs (invest)' ],
479+ model .variables ['Sink(Wärme)->costs (invest)' ] + (model .variables ['Sink(Wärme)|is_invested' ] - 1 ) * 500 == 0 ,
480480 )
481481
482482
@@ -558,12 +558,12 @@ def test_effects_per_running_hour(self, basic_flow_system_linopy):
558558 'Wärme' ,
559559 bus = 'Fernwärme' ,
560560 on_off_parameters = fx .OnOffParameters (
561- effects_per_running_hour = {'Costs ' : costs_per_running_hour , 'CO2' : co2_per_running_hour }
561+ effects_per_running_hour = {'costs ' : costs_per_running_hour , 'CO2' : co2_per_running_hour }
562562 ),
563563 )
564564 flow_system .add_elements (fx .Sink ('Sink' , sink = flow ), fx .Effect ('CO2' , 't' , '' ))
565565 model = create_linopy_model (flow_system )
566- costs , co2 = flow_system .effects ['Costs ' ], flow_system .effects ['CO2' ]
566+ costs , co2 = flow_system .effects ['costs ' ], flow_system .effects ['CO2' ]
567567
568568 assert_sets_equal (
569569 set (flow .submodel .variables ),
@@ -586,12 +586,12 @@ def test_effects_per_running_hour(self, basic_flow_system_linopy):
586586 msg = 'Incorrect constraints' ,
587587 )
588588
589- assert 'Sink(Wärme)->Costs (operation)' in set (costs .submodel .constraints )
589+ assert 'Sink(Wärme)->costs (operation)' in set (costs .submodel .constraints )
590590 assert 'Sink(Wärme)->CO2(operation)' in set (co2 .submodel .constraints )
591591
592592 assert_conequal (
593- model .constraints ['Sink(Wärme)->Costs (operation)' ],
594- model .variables ['Sink(Wärme)->Costs (operation)' ]
593+ model .constraints ['Sink(Wärme)->costs (operation)' ],
594+ model .variables ['Sink(Wärme)->costs (operation)' ]
595595 == flow .submodel .variables ['Sink(Wärme)|on' ] * model .hours_per_step * costs_per_running_hour ,
596596 )
597597
@@ -943,7 +943,7 @@ def test_switch_on_constraints(self, basic_flow_system_linopy):
943943 size = 100 ,
944944 on_off_parameters = fx .OnOffParameters (
945945 switch_on_total_max = 5 , # Maximum 5 startups
946- effects_per_switch_on = {'Costs ' : 100 }, # 100 EUR startup cost
946+ effects_per_switch_on = {'costs ' : 100 }, # 100 EUR startup cost
947947 ),
948948 )
949949
@@ -984,12 +984,12 @@ def test_switch_on_constraints(self, basic_flow_system_linopy):
984984 )
985985
986986 # Check that startup cost effect constraint exists
987- assert 'Sink(Wärme)->Costs (operation)' in model .constraints
987+ assert 'Sink(Wärme)->costs (operation)' in model .constraints
988988
989989 # Verify the startup cost effect constraint
990990 assert_conequal (
991- model .constraints ['Sink(Wärme)->Costs (operation)' ],
992- model .variables ['Sink(Wärme)->Costs (operation)' ] == flow .submodel .variables ['Sink(Wärme)|switch|on' ] * 100 ,
991+ model .constraints ['Sink(Wärme)->costs (operation)' ],
992+ model .variables ['Sink(Wärme)->costs (operation)' ] == flow .submodel .variables ['Sink(Wärme)|switch|on' ] * 100 ,
993993 )
994994
995995 def test_on_hours_limits (self , basic_flow_system_linopy ):
0 commit comments