Skip to content

🐛🤖 Energy mix: scope and rewrite the processing descriptions - #6674

Merged
pabloarosado merged 11 commits into
masterfrom
data-energymix-fixdescriptions
Aug 14, 2026
Merged

🐛🤖 Energy mix: scope and rewrite the processing descriptions#6674
pabloarosado merged 11 commits into
masterfrom
data-energymix-fixdescriptions

Conversation

@pabloarosado

@pabloarosado pabloarosado commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Written by Claude Opus 5 — @pabloarosado at the wheel.

Both description_processing notes of garden/energy/2026-06-30/energy_mix lived in the shared definitions.common block, so all 81 indicators inherited both, and each note was wrong for most of them:

  • The EIA note appeared on by-source indicators, although the EIA only extends the total. Primary energy from low-carbon sources told readers its values were extended with EIA data.
  • The "traditional biomass is excluded" note appeared on Share of primary energy including traditional biomass, whose denominator includes it, and on Global primary energy by source, which stacks biomass next to the other sources. It also described the producer's scope rather than our processing, so it is gone.
  • The Smil long-run note appeared on the 28 annual-change indicators, which have no pre-1965 values at all (Smil's years are decadal, and only consecutive years produce an annual change), and claimed 1800 for energy per GDP, which starts in 1820 because Maddison's World GDP does.

Each note is now applied only where it holds:

Indicators Note
38 absolute, per capita, shares of the total Smil long-run World series, from 1800
26 by-source annual change none
2 total annual change EIA extension of the total
total_energy_supply_twh, _per_capita_kwh EIA extension + Smil from 1800
total_energy_supply_per_gdp_kwh_per_dollar EIA extension + Smil from 1820, via Maddison GDP
9 *_share_including_biomass_pct Smil's biomass added to the denominator, held at its 2015 value afterwards, + Smil long-run
traditional_biomass_twh and its share Smil, World only, from 1800, held at its 2015 value

The wording of the Smil note is also plainer, and the EIA note no longer says the extension covers "countries not covered by the Statistical Review": it also fills country-years where the Statistical Review reports individual fuels but no total.

Origins

Charts cite an indicator's origins, so the same problem showed up there: derived columns inherited producers that contribute nothing to them. Annual change in primary energy by source credited Smil while starting in 1965. Two sets of origins are now dropped in the garden step:

  • Smil, from the 28 annual-change indicators.
  • The EIA, from the 10 biomass-inclusive share indicators: they are World-only, and the World total comes from the Statistical Review for 1965-2025 with no gaps, or Smil before that.

No data values change. Every remaining claim was re-checked against the built data (start years, which indicators carry EIA-derived values, the World-only and held-constant claims, and that the biomass-inclusive shares sum to 100%): 81 indicators, 0 failures.

Left open

The 13 *_share_pct indicators keep the EIA origin, which is honest today: their denominator is the EIA-extended total, so South America's shares divide an EI numerator by an EIA denominator. That is #6681, and the origin should be dropped when it is fixed.

pabloarosado and others added 2 commits August 14, 2026 11:19
The EIA note was in the shared definitions block, so every indicator claimed
to be extended with EIA data, when the EIA is only used to extend total energy
supply. It now sits on total energy supply and the indicators derived from it.

The Smil note is split in two, so the shares of primary energy including
traditional biomass no longer claim to exclude it, and its wording is plainer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pabloarosado pabloarosado changed the title 📊 Energy mix: fix processing descriptions 🐛🤖 Energy mix: scope and rewrite the processing descriptions Aug 14, 2026
@owidbot

owidbot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs Docs Preview

Login: ssh owid@staging-site-data-energymix-fixdescriptio

chart-diff: ✅ No charts for review.
data-diff: ❌ 1 changed · 1 identical — full report
~ garden/energy/2026-06-30/energy_mix
    ~ energy_mix.biofuels_annual_change_pct (changed metadata)
    ~ energy_mix.biofuels_annual_change_twh (changed metadata)
    ~ energy_mix.biofuels_per_capita_kwh (changed metadata)
    ~ energy_mix.biofuels_share_including_biomass_pct (changed metadata)
    ~ energy_mix.biofuels_share_pct (changed metadata)
    ~ energy_mix.biofuels_twh (changed metadata)
    ~ energy_mix.coal_annual_change_pct (changed metadata)
    ~ energy_mix.coal_annual_change_twh (changed metadata)
    ~ energy_mix.coal_per_capita_kwh (changed metadata)
    ~ energy_mix.coal_share_including_biomass_pct (changed metadata)
    ~ energy_mix.coal_share_pct (changed metadata)
    ~ energy_mix.coal_twh (changed metadata)
    ~ energy_mix.fossil_fuels_annual_change_pct (changed metadata)
    ~ energy_mix.fossil_fuels_annual_change_twh (changed metadata)
    ~ energy_mix.fossil_fuels_per_capita_kwh (changed metadata)
    ~ energy_mix.fossil_fuels_share_pct (changed metadata)
    ~ energy_mix.fossil_fuels_twh (changed metadata)
    ~ energy_mix.gas_annual_change_pct (changed metadata)
    ~ energy_mix.gas_annual_change_twh (changed metadata)
    ~ energy_mix.gas_per_capita_kwh (changed metadata)
    ~ energy_mix.gas_share_including_biomass_pct (changed metadata)
    ~ energy_mix.gas_share_pct (changed metadata)
    ~ energy_mix.gas_twh (changed metadata)
    ~ energy_mix.hydro_annual_change_pct (changed metadata)
    ~ energy_mix.hydro_annual_change_twh (changed metadata)
    ~ energy_mix.hydro_per_capita_kwh (changed metadata)
    ~ energy_mix.hydro_share_including_biomass_pct (changed metadata)
    ~ energy_mix.hydro_share_pct (changed metadata)
    ~ energy_mix.hydro_twh (changed metadata)
    ~ energy_mix.low_carbon_energy_annual_change_pct (changed metadata)
    ~ energy_mix.low_carbon_energy_annual_change_twh (changed metadata)
    ~ energy_mix.low_carbon_energy_per_capita_kwh (changed metadata)
    ~ energy_mix.low_carbon_energy_share_pct (changed metadata)
    ~ energy_mix.low_carbon_energy_twh (changed metadata)
    ~ energy_mix.nuclear_annual_change_pct (changed metadata)
    ~ energy_mix.nuclear_annual_change_twh (changed metadata)
    ~ energy_mix.nuclear_per_capita_kwh (changed metadata)
    ~ energy_mix.nuclear_share_including_biomass_pct (changed metadata)
    ~ energy_mix.nuclear_share_pct (changed metadata)
    ~ energy_mix.nuclear_twh (changed metadata)
    ~ energy_mix.oil_annual_change_pct (changed metadata)
    ~ energy_mix.oil_annual_change_twh (changed metadata)
    ~ energy_mix.oil_per_capita_kwh (changed metadata)
    ~ energy_mix.oil_share_including_biomass_pct (changed metadata)
    ~ energy_mix.oil_share_pct (changed metadata)
    ~ energy_mix.oil_twh (changed metadata)
    ~ energy_mix.other_renewables_annual_change_pct (changed metadata)
    ~ energy_mix.other_renewables_annual_change_twh (changed metadata)
    ~ energy_mix.other_renewables_per_capita_kwh (changed metadata)
    ~ energy_mix.other_renewables_share_including_biomass_pct (changed metadata)
    ~ energy_mix.other_renewables_share_pct (changed metadata)
    ~ energy_mix.other_renewables_twh (changed metadata)
    ~ energy_mix.renewables_annual_change_pct (changed metadata)
    ~ energy_mix.renewables_annual_change_twh (changed metadata)
    ~ energy_mix.renewables_per_capita_kwh (changed metadata)
    ~ energy_mix.renewables_share_pct (changed metadata)
    ~ energy_mix.renewables_twh (changed metadata)
    ~ energy_mix.solar_and_wind_annual_change_pct (changed metadata)
    ~ energy_mix.solar_and_wind_annual_change_twh (changed metadata)
    ~ energy_mix.solar_and_wind_per_capita_kwh (changed metadata)
    ~ energy_mix.solar_and_wind_share_pct (changed metadata)
    ~ energy_mix.solar_and_wind_twh (changed metadata)
    ~ energy_mix.solar_annual_change_pct (changed metadata)
    ~ energy_mix.solar_annual_change_twh (changed metadata)
    ~ energy_mix.solar_per_capita_kwh (changed metadata)
    ~ energy_mix.solar_share_including_biomass_pct (changed metadata)
    ~ energy_mix.solar_share_pct (changed metadata)
    ~ energy_mix.solar_twh (changed metadata)
    ~ energy_mix.total_energy_supply_annual_change_pct (changed metadata)
    ~ energy_mix.total_energy_supply_annual_change_twh (changed metadata)
    ~ energy_mix.total_energy_supply_per_capita_kwh (changed metadata)
    ~ energy_mix.total_energy_supply_per_gdp_kwh_per_dollar (changed metadata)
    ~ energy_mix.total_energy_supply_twh (changed metadata)
    ~ energy_mix.traditional_biomass_share_including_biomass_pct (changed metadata)
    ~ energy_mix.traditional_biomass_twh (changed metadata)
    ~ energy_mix.wind_annual_change_pct (changed metadata)
    ~ energy_mix.wind_annual_change_twh (changed metadata)
    ~ energy_mix.wind_per_capita_kwh (changed metadata)
    ~ energy_mix.wind_share_including_biomass_pct (changed metadata)
    ~ energy_mix.wind_share_pct (changed metadata)
    ~ energy_mix.wind_twh (changed metadata)

= 1 compared dataset(s) turned out identical; details in the full report

Automatically updated datasets matching excess_mortality|covid|fluid|flunet|country_profile|garden/ihme_gbd/2019/gbd_risk are not included. Run locally with etl diff REMOTE data/ --include <dataset> --verbose.

Edited: 2026-08-14 18:13:11 UTC
Execution time: 21.43 seconds

pabloarosado and others added 8 commits August 14, 2026 18:11
… applies to

Every indicator inherited both notes from the shared definitions block, so
by-source indicators claimed to be extended with EIA data (which only extends
the total), and the shares of primary energy including traditional biomass
claimed to exclude it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ot processing

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Smil's years are decadal before 1965, and only consecutive years produce an
annual change, so none of the 28 annual-change indicators has a pre-1965 value.
The annual change of the total keeps the EIA note, which does apply to it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Maddison's World GDP starts in 1820, so that series does not go back to 1800
like the rest. Also state the year traditional biomass starts.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Charts cite an indicator's origins, so the annual-change indicators credited
Smil for data they cannot contain (its World series is decadal before 1965, and
only consecutive years produce an annual change), and the biomass-inclusive
shares credited the EIA although they are World-only, where the total always
comes from the Statistical Review or Smil.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… it measures

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pabloarosado
pabloarosado marked this pull request as ready for review August 14, 2026 18:02
@pabloarosado
pabloarosado requested a lite review from Copilot August 14, 2026 18:03
@pabloarosado pabloarosado self-assigned this Aug 14, 2026
@pabloarosado

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 77a40f1761

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread etl/steps/data/garden/energy/2026-06-30/energy_mix.meta.yml
Comment thread etl/steps/data/garden/energy/2026-06-30/energy_mix.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines metadata for the garden/energy/2026-06-30/energy_mix dataset so that description_processing text and indicator origins are applied only where they are accurate, avoiding incorrect notes/citations on derived indicators.

Changes:

  • Adds a small helper in the garden step to remove producer origins from derived columns when that producer contributes no values (e.g., Smil on annual-change indicators; EIA on biomass-inclusive World-only shares).
  • Reworks energy_mix.meta.yml to split processing notes into targeted definitions and apply them per-indicator (including clearing the common note where none applies).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
etl/steps/data/garden/energy/2026-06-30/energy_mix.py Drops misleading origins from specific derived columns so chart citations better reflect actual contributing producers.
etl/steps/data/garden/energy/2026-06-30/energy_mix.meta.yml Scopes processing descriptions by indicator type/source to avoid incorrect inherited notes.
Suppressed comments (1)

etl/steps/data/garden/energy/2026-06-30/energy_mix.meta.yml:762

  • Duplicate description_processing keys under total_energy_supply_annual_change_twh make the YAML invalid/ambiguous; the later key will override the earlier one, and this may also break metadata parsing. Keep a single description_processing entry (per PR description, this annual-change indicator should only carry the EIA note, not the Smil long-run note).
        description_processing: |-
          {definitions.description_processing_eia}
          {definitions.description_processing_smil_world}
        description_processing: |-
          {definitions.description_processing_eia}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread etl/steps/data/garden/energy/2026-06-30/energy_mix.meta.yml Outdated
The two total annual-change indicators each had two description_processing
blocks. YAML resolved the last one, so the output was right by luck, but the
file was ambiguous. Also correct the docstring that said Smil's World series is
decadal only before 1900: it is decadal from 1800 to 1960.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pabloarosado
pabloarosado merged commit 066c5b6 into master Aug 14, 2026
6 checks passed
@pabloarosado
pabloarosado deleted the data-energymix-fixdescriptions branch August 14, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants