Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📊 energy: Fix missing energy data for Saudi Arabia #3322

Merged
merged 5 commits into from
Sep 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,25 @@ def run(dest_dir: str) -> None:
tb = fix_missing_nuclear_energy_data(tb=tb)

####################################################################################################################
# Wind generation for Saudi Arabia in 2022 and 2023 is possibly wrong.
# Similarly to missing nuclear data, hydropower is missing from year 2000 onwards, at least for Saudi Arabia.
# However, in the excel data file, those values are zero.
# Fill those missing points with zeros.
error = "Expected missing data for Arabia's hydropower from 2000 on. It may be fixed, so, remove this code."
assert (
tb.loc[
(tb["country"] == "Saudi Arabia") & (tb["year"] >= 2000),
["hydro_consumption_equivalent_ej", "hydro_electricity_generation_twh"],
]
.isnull()
.all()
.all()
), error
tb.loc[
(tb["country"] == "Saudi Arabia") & (tb["year"] >= 2000),
["hydro_consumption_equivalent_ej", "hydro_electricity_generation_twh"],
] = 0

# Wind generation (and consumption) for Saudi Arabia in 2022 and 2023 is possibly wrong.
# It goes from 0.005678 TWh in 2021 to 1.45 TWh in 2022 and 2023.
# According to IRENA, Saudi Arabia's wind capacity was 3MW in 2022:
# https://www.irena.org/Publications/2023/Jul/Renewable-energy-statistics-2023
Expand All @@ -626,9 +644,16 @@ def run(dest_dir: str) -> None:
assert (
tb[(tb["country"] == "Saudi Arabia") & (tb["year"] == 2022)]["wind_electricity_generation_twh"].item() > 1.45
), error
tb = tb.drop(tb[(tb["country"] == "Saudi Arabia") & (tb["year"].isin([2022, 2023]))].index.tolist()).reset_index(
drop=True
)
assert (
tb[(tb["country"] == "Saudi Arabia") & (tb["year"] == 2021)]["wind_consumption_equivalent_ej"].item() < 0.00006
), error
assert (
tb[(tb["country"] == "Saudi Arabia") & (tb["year"] == 2022)]["wind_consumption_equivalent_ej"].item() > 0.01
), error
tb.loc[
(tb["country"] == "Saudi Arabia") & (tb["year"].isin([2022, 2023])),
["wind_consumption_equivalent_ej", "wind_electricity_generation_twh"],
] = None
####################################################################################################################

# Create additional variables, like primary energy consumption in TWh (both direct and in input-equivalents).
Expand Down
Loading