Improve calculation of the share of electricity in primary energy #2196
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We currently calculate the share of electricity in primary energy consumption (shown in this chart) as simply dividing the total electricity generation by primary energy consumption.
However, primary energy consumption (from the Statistical Review of World Energy) is defined in "input-equivalents" (what we usually call the substitution method). This means that non-fossil electricity sources (nuclear, hydro, solar, wind, bioenergy and other renewables) are inflated to mimic the inefficiencies of fossil fuels. To achieve that, the Statistical Review divides the electricity generation of non-fossil sources by an efficiency factor (which is roughly between 0.3 and 0.5).
Therefore, currently, our share of electricity in primary energy is underestimated. We claim in the subtitle that we use the substitution method, but we only do this in the denominator, not in the numerator.
This PR does the calculation of the share of electricity in primary energy properly:
100 * (((electricity generated by non-fossil sources) / efficiency factor) + (electricity generated by fossil fuels) ) / (primary energy consumption)
An alternative would be to estimate the direct primary energy consumption (not using the substitution method), and then simply divide total generation by direct primary energy consumption. This is also possible, but since we use the substitution method in most charts showing primary energy, it makes sense to use it here too.
To clarify, the affected chart (also included in the energy explorer) will barely be affected for countries that rely mostly on fossil fuels. But for countries that have a big share of renewables and nuclear, the change can be significant. One of the most significant examples is Norway. Here's the comparison of the old (currently in production) and new (this PR) indicator:

And the missing points in the new curve happen because we don't have electricity generation disaggregated by source for all countries and years (for which we do have total electricity generation and primary energy consumption).