Skip to content

Emissions - #199

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

Emissions#199
kndehaan merged 10 commits into
masterfrom
emissions

Conversation

@louispt1

@louispt1 louispt1 commented Jul 14, 2026

Copy link
Copy Markdown
Member

Context

Adds multi-year emissions support with 1990 baseline tracking and aggregation capabilities.
Also covers multi-line group handling

Implemented changes

  • Added year column to emissions CSV schema
  • Implemented Qernel::Emissions#sum() for subsector aggregation
  • Updated EMISSIONS() GQL function to aggregate across subsectors
  • Enhanced ScopedSector with year-aware scoping
  • Updated atlas gem dependency (includes emissions schema changes)

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

@louispt1
louispt1 requested a review from kndehaan July 14, 2026 09:10
@louispt1 louispt1 mentioned this pull request Jul 14, 2026
3 tasks
@mabijkerk

Copy link
Copy Markdown
Member

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

Etsource::Sectors#build_node_index normalizes use but not sector_label
(etsource/sectors.rb):

pair = [node.sector_label, Atlas::SectorMapping.normalize(node.use)]

Atlas's row_pair normalizes both sides. This works today because sector_label is declared Symbol and every .ad happens to use a slug already — but a label written with a capital, space, or dash produces a pair matching nothing, and the node then silently vanishes from SECTOR(...) results and from the CSV export with no error. Normalizing both sides costs nothing.

@kndehaan

Copy link
Copy Markdown
Member

Also here, I think this finding should not block the merging of the PR. I'll discuss this point with @louispt1 next week.

@kndehaan
kndehaan merged commit b2d47a1 into master Jul 17, 2026
1 check passed
@kndehaan
kndehaan deleted the emissions branch July 17, 2026 14:01
@louispt1

Copy link
Copy Markdown
Member Author

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

Etsource::Sectors#build_node_index normalizes use but not sector_label (etsource/sectors.rb):

pair = [node.sector_label, Atlas::SectorMapping.normalize(node.use)]

Atlas's row_pair normalizes both sides. This works today because sector_label is declared Symbol and every .ad happens to use a slug already — but a label written with a capital, space, or dash produces a pair matching nothing, and the node then silently vanishes from SECTOR(...) results and from the CSV export with no error. Normalizing both sides costs nothing.

The ETSource spec will catch drift between the normalised labels so there is no need to normalise in both locations. It's not a coincidence that every sector_label is written as a slug now, that's a style and code choice and the spec will fail if there's a mistake in that respect

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