pypsa-meets-earth / pypsa-earth-sec

GNU General Public License v3.0
19 stars 17 forks source link

Objective value for CI returns nan unless load_shedding is true #361

Open GbotemiB opened 1 month ago

GbotemiB commented 1 month ago

Checklist

Describe the Bug

The test config for CI returns nan unless load_shedding is set to True

Please provide a description of what the bug is and add a minimal example/command for reproducing the bug.

Error Message

If applicable, paste any terminal output to help illustrating your problem.

WARNING:pypsa.io:The following Link have buses which are not defined:
Index(['H2 pipeline NG.10_1 -> NG.12_1', 'H2 pipeline NG.12_1 -> NG.10_1',
       'H2 pipeline NG.12_1 -> NG.23_1', 'H2 pipeline NG.12_1 -> NG.29_1',
       'H2 pipeline NG.14_1 -> NG.23_1', 'H2 pipeline NG.15_1 -> NG.19_1',
       'H2 pipeline NG.19_1 -> NG.20_1', 'H2 pipeline NG.19_1 -> NG.37_1',
       'H2 pipeline NG.1_1 -> NG.14_1', 'H2 pipeline NG.23_1 -> NG.26_1',
       'H2 pipeline NG.23_1 -> NG.27_1', 'H2 pipeline NG.23_1 -> NG.7_1',
       'H2 pipeline NG.24_1 -> NG.27_1', 'H2 pipeline NG.25_1 -> BJ.8_1',
       'H2 pipeline NG.25_1 -> NG.28_1', 'H2 pipeline NG.26_1 -> NG.15_1',
       'H2 pipeline NG.27_1 -> NG.19_1', 'H2 pipeline NG.28_1 -> NG.25_1',
       'H2 pipeline NG.28_1 -> NG.31_1', 'H2 pipeline NG.29_1 -> NG.12_1',
       'H2 pipeline NG.29_1 -> NG.23_1', 'H2 pipeline NG.29_1 -> NG.28_1',
       'H2 pipeline NG.30_1 -> NG.24_1', 'H2 pipeline NG.30_1 -> NG.29_1',
       'H2 pipeline NG.31_1 -> NG.30_1', 'H2 pipeline NG.33_1 -> NG.10_1',
       'H2 pipeline NG.33_1 -> NG.1_1', 'H2 pipeline NG.3_1 -> NG.33_1',
       'H2 pipeline NG.3_1 -> NG.9_1', 'H2 pipeline NG.6_1 -> NG.10_1',
       'H2 pipeline NG.6_1 -> NG.33_1', 'H2 pipeline NG.7_1 -> NG.26_1'],
      dtype='object', name='name')
WARNING:pypsa.io:The following Link have buses which are not defined:
Index(['H2 pipeline NG.10_1 -> NG.12_1', 'H2 pipeline NG.12_1 -> NG.10_1',
       'H2 pipeline NG.12_1 -> NG.23_1', 'H2 pipeline NG.12_1 -> NG.29_1',
       'H2 pipeline NG.14_1 -> NG.23_1', 'H2 pipeline NG.15_1 -> NG.19_1',
       'H2 pipeline NG.19_1 -> NG.20_1', 'H2 pipeline NG.19_1 -> NG.37_1',
       'H2 pipeline NG.1_1 -> NG.14_1', 'H2 pipeline NG.23_1 -> NG.26_1',
       'H2 pipeline NG.23_1 -> NG.27_1', 'H2 pipeline NG.23_1 -> NG.7_1',
       'H2 pipeline NG.24_1 -> NG.27_1', 'H2 pipeline NG.25_1 -> BJ.8_1',
       'H2 pipeline NG.25_1 -> NG.28_1', 'H2 pipeline NG.26_1 -> NG.15_1',
       'H2 pipeline NG.27_1 -> NG.19_1', 'H2 pipeline NG.28_1 -> NG.25_1',
       'H2 pipeline NG.28_1 -> NG.31_1', 'H2 pipeline NG.29_1 -> NG.12_1',
       'H2 pipeline NG.29_1 -> NG.23_1', 'H2 pipeline NG.29_1 -> NG.28_1',
       'H2 pipeline NG.30_1 -> NG.24_1', 'H2 pipeline NG.30_1 -> NG.29_1',
       'H2 pipeline NG.31_1 -> NG.30_1', 'H2 pipeline NG.33_1 -> NG.10_1',
       'H2 pipeline NG.33_1 -> NG.1_1', 'H2 pipeline NG.3_1 -> NG.33_1',
       'H2 pipeline NG.3_1 -> NG.9_1', 'H2 pipeline NG.6_1 -> NG.10_1',
       'H2 pipeline NG.6_1 -> NG.33_1', 'H2 pipeline NG.7_1 -> NG.26_1'],
      dtype='object', name='name')
WARNING:pypsa.io:Components Index(['BJ1 residential biomass', 'BJ1 residential oil',
       'NG0 residential biomass', 'NG0 residential oil',
       'NG2 residential biomass', 'NG2 residential oil'],
      dtype='object', name='Load') for attribute p_set of Load are not in main components dataframe loads
INFO:pypsa.io:Imported network elec_s_4_ec_lc1_Co2L_144H_2030_0.071_AB_120export.nc has buses, carriers, generators, global_constraints, lines, links, loads, storage_units, stores
INFO:pypsa.linopf:Prepare linear problem
INFO:__main__:no h2 export constraint set
WARNING:__main__:Impossible to set H2 cap for the following links: Index(['BJ1 0 Fischer-Tropsch', 'BJ1 0 H2 Electrolysis', 'BJ1 0 H2 Fuel Cell',
       'BJ1 0 H2 export', 'BJ1 0 OCGT', 'BJ1 0 SMR', 'BJ1 0 SMR CC',
       'BJ1 0 Sabatier', 'BJ1 0 battery charger', 'BJ1 0 battery discharger',
       ...
       'NG2 0 urban central gas CHP CC', 'NG2 0 urban central gas boiler',
       'NG2 0 urban central resistive heater',
       'NG2 0 urban central solid biomass CHP',
       'NG2 0 urban central solid biomass CHP CC',
       'NG2 0 urban central water tanks charger',
       'NG2 0 urban central water tanks discharger',
       'biomass transport NG0 0 <-> NG0 1',
       'biomass transport NG0 1 <-> NG0 0', 'process emissions'],
      dtype='object', length=206)
INFO:pypsa.linopf:Total preparation time: 1.17s
INFO:pypsa.linopf:Solve linear problem using Cbc solver
WARNING:pypsa.linopf:Optimization failed with status warning and termination condition other
INFO:pypsa.io:Exported network elec_s_4_ec_lc1_Co2L_144H_2030_0.071_AB_120export.nc has stores, carriers, lines, links, buses, storage_units, generators, global_constraints, loads
INFO:__main__:Objective function: nan
INFO:__main__:Objective constant: 1862023.814238865
INFO:__main__:Maximum memory usage: (577.03125, 1721641663.650857)

In some cases it may also be useful to share your list of installed packages: conda list.

<paste here>
davide-f commented 1 month ago

Fixed with https://github.com/pypsa-meets-earth/pypsa-earth-sec/pull/360 ; many thanks! :D Do I get it right?