pypsa-meets-earth / pypsa-earth-sec

GNU General Public License v3.0
18 stars 16 forks source link

aggregate_fuels contains two definitions of the coal_fuels list and extra values not present in get_conv_factors #310

Open finozzifa opened 1 month ago

finozzifa commented 1 month ago

Checklist

Describe the Bug

In a nutshell, one of the inputs used in pypsa-earth-sec for _rule build_base_energytotals contains a few typos (e.g. "Hrad coal") and many duplicated entries (e.g. "Coke-oven coke", "Coke oven coke" and "Coke Oven Coke"). Such typos and duplicated entries have been propagated in the method _get_convfactors and in the method _aggregatefuels. Moreover, _aggregatefuels contains two mutually exclusive definitions for the list _coalfuels. Finally, the method _aggregatefuels does not use the function argument sector. More details below:

-) Issue 1 : _aggregatefuels contains two definitions of the coal_fuels list. Namely

coal_fuels = [
    "Anthracite",
    "Brown coal",
    "Brown coal briquettes",
    "Coke-oven coke",
    "Coke Oven Coke",
    "Hard coal",
    "Other bituminous coal",
    "Sub-bituminous coal",
    "Coking coal",
    "Bitumen",
]

and

coal_fuels = [
    "Anthracite",
    "Charcoal",
    "Coke oven coke",
    "Coke-oven coke",
    "Coke Oven Coke",
    "Coking coal",
    "Hard coal",
    "Other bituminous coal",
    "Petroleum coke",
    "Petroleum Coke",
    "Hrad coal",
    "Lignite",
    "Peat",
    "Peat products",
]

-) Issue 2 : the argument sector in _aggregatefuels is not used in the function.

-) Issue 3 : the method _aggregatefuels is used in conjunction with the method _get_convfactors. However not all entries from _aggregatefuels are present in _get_convfactors. For example "Blast Furnace Gas" is present is _aggregatefuels but not in _get_convfactors

-) Issue 4: the input data processed with the methods contain typos. For example Hrad coal, instead of Hard coal.