Skip to content

Direct emissions chart and dashboard items, mapping file, 1990 data#3463

Merged
kndehaan merged 52 commits into
masterfrom
emissions
Jul 17, 2026
Merged

Direct emissions chart and dashboard items, mapping file, 1990 data#3463
kndehaan merged 52 commits into
masterfrom
emissions

Conversation

@kndehaan

@kndehaan kndehaan commented Jul 16, 2026

Copy link
Copy Markdown
Member

Context

This PR adds the queries for a new chart and dashboard items, using a newly introduced mapping file structure.

Implemented changes

  • Queries for GHG emissions chart and dashboard items
  • New mapping structure including mapping file and new sector label attribute
  • Modified setup of the data export using the mapping structure
  • 1990 emission data added to emissions.csv, following the emissions data pipeline

Related

Goes with pull requests:

Checklist

  • I have tested these changes
  • I have updated documentation as needed
  • I have tagged the relevant people for review

@kndehaan kndehaan changed the title Direct emissions Direct emissions chart and dashboard items, mapping file, 1990 data Jul 16, 2026
@kndehaan
kndehaan requested a review from mabijkerk July 16, 2026 11:24
@kndehaan
kndehaan marked this pull request as ready for review July 16, 2026 11:24
@mabijkerk

Copy link
Copy Markdown
Member

I had AI do a full review of the branches, it flagged the following:

LULUCF removals get the wrong sign in the mapped form

The two 1990 LULUCF queries disagree about what "LULUCF" means:

  • direct_emissions_lulucf_co2_1990 names the pairs explicitly and negates
    removals:
    SUM(EMISSIONS(lulucf_emissions, …), NEG(EMISSIONS(lulucf_removals, …)))
  • direct_emissions_lulucf_other_ghg_1990 uses the new mapped form
    EMISSIONS(emissions_sector, "LULUCF", other_ghg, 1990), and sum_pairs
    sums over both lulucf_emissions and lulucf_removals.

It's harmless today only because no dataset has an
LULUCF,Removals,…,other_ghg row — nl has removals for co2 only. The day
someone adds one, it gets added instead of subtracted, silently. Worth either
using the explicit-pair form for consistency, or leaving a comment noting the
mapped form is only safe while removals stay CO2-only.

Comment on lines +44 to +52
# For example:
# - name: Use
# label: "Use"
# type: sector_mapping
# value: use
# - name: IPCC_CRT_code_agg
# label: "IPCC CRT code (aggregated)"
# type: sector_mapping
# value: ipcc_crt_code_agg

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this still valid?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's still valid, it gives an example of how we could add a new column to the data export and how this relates to the columns in the mapping file.

@kndehaan

kndehaan commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

It's harmless today only because no dataset has an
LULUCF,Removals,…,other_ghg row — nl has removals for co2 only. The day
someone adds one, it gets added instead of subtracted, silently.

By IPCC definition, removals in LULUCF only apply for CO2. It's not possible to have removals for other GHG. I updated the descriptions in the doc strings to further clarify this.

Note to ourselves: good practice to provide clear doc strings when queries deviate from "standard queries". This will also gives context to the AI review to understand why the query is different.

@mabijkerk mabijkerk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's do it!

@kndehaan
kndehaan merged commit a85c1b6 into master Jul 17, 2026
1 check passed
@kndehaan
kndehaan deleted the emissions branch July 17, 2026 14:10
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.

4 participants