@@ -171,9 +171,9 @@ def _pypsa_network_preprocessing(self) -> None:
171171 co2_emissions = 0 ,
172172 max_growth = any_to_float (inf ),
173173 )
174- self .pypsa_network .carriers ["carrier" ] = (
175- self . pypsa_network . carriers . index . values
176- )
174+ self .pypsa_network .carriers [
175+ "carrier"
176+ ] = self . pypsa_network . carriers . index . values
177177 ### Rename PyPSA buses, to delete spaces
178178 if len (self .pypsa_network .buses ) > 0 :
179179 self .pypsa_network .buses .index = self .pypsa_network .buses .index .str .replace (
@@ -364,32 +364,32 @@ def _register_pypsa_globalconstraints(self) -> None:
364364 ],
365365 )
366366 if carrier_attribute == "co2_emissions" and sense == "<=" :
367- self .pypsa_globalconstraints_data [pypsa_model_id ] = (
368- PyPSAGlobalConstraintData (
369- name ,
370- carrier_attribute ,
371- sense ,
372- self . pypsa_network . global_constraints . loc [
373- pypsa_model_id , "constant"
374- ],
375- "global_constraint_co2_max" ,
376- "emission_port " ,
377- gems_components_and_ports ,
378- )
367+ self .pypsa_globalconstraints_data [
368+ pypsa_model_id
369+ ] = PyPSAGlobalConstraintData (
370+ name ,
371+ carrier_attribute ,
372+ sense ,
373+ self . pypsa_network . global_constraints . loc [
374+ pypsa_model_id , "constant"
375+ ] ,
376+ "global_constraint_co2_max " ,
377+ "emission_port" ,
378+ gems_components_and_ports ,
379379 )
380380 elif carrier_attribute == "co2_emissions" and sense == "==" :
381- self .pypsa_globalconstraints_data [pypsa_model_id ] = (
382- PyPSAGlobalConstraintData (
383- name ,
384- carrier_attribute ,
385- sense ,
386- self . pypsa_network . global_constraints . loc [
387- pypsa_model_id , "constant"
388- ],
389- "global_constraint_co2_eq" ,
390- "emission_port " ,
391- gems_components_and_ports ,
392- )
381+ self .pypsa_globalconstraints_data [
382+ pypsa_model_id
383+ ] = PyPSAGlobalConstraintData (
384+ name ,
385+ carrier_attribute ,
386+ sense ,
387+ self . pypsa_network . global_constraints . loc [
388+ pypsa_model_id , "constant"
389+ ] ,
390+ "global_constraint_co2_eq " ,
391+ "emission_port" ,
392+ gems_components_and_ports ,
393393 )
394394 else :
395395 raise ValueError ("Type of GlobalConstraint not supported." )
0 commit comments