Skip to content

Add an "emissions diagnostics" processor#3

Merged
danielhuppmann merged 12 commits into
mainfrom
feature/emissions-diagnostics
Apr 10, 2026
Merged

Add an "emissions diagnostics" processor#3
danielhuppmann merged 12 commits into
mainfrom
feature/emissions-diagnostics

Conversation

@danielhuppmann

@danielhuppmann danielhuppmann commented Apr 8, 2026

Copy link
Copy Markdown
Member

This PR transfers the script for the Scenario Compass to compute emissions-diagnostics indicators and implements it as a nomenclature Processor subclass.

The idea is that this can be imported in a workflow as

from scenariocompass import EmissionsDiagnostics

emissions_diagnostics = EmissionsDiagnostics()

and then either in a longer processing workflow simply calling

df = emissions_diagnostics.apply(df)

or as a stand-alone (atomic) workflow like

df = pyam.read_ixmp4(platform, **emissions_diagnostics.input_data)
df = emissions_diagnostics.apply(df)

and then write only emissions_diagnostics.output_meta back to the platform.

Any thoughts about the design?

@danielhuppmann danielhuppmann self-assigned this Apr 8, 2026
@dc-almeida

Copy link
Copy Markdown
Contributor

I don't really have the domain knowledge to comment on whether what the processor is doing makes sense, but on the code/design side, I'd say, it would be good to have docstrings for the methods/functions, and if there are any variables/regions that are mandatory for processing to work, then to add some Pydantic validator to check that.

@phackstock phackstock 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.

Looks good to me in principle a few small comments and suggestions in line below.

Comment thread scenariocompass/emissions_diagnostics.py Outdated
Comment thread scenariocompass/emissions_diagnostics.py
Comment thread scenariocompass/emissions_diagnostics.py
Comment thread pyproject.toml Outdated
@danielhuppmann

Copy link
Copy Markdown
Member Author

Thanks for the review comments - I added tests to make sure that either an error is raised when the wrong units are used or that df isn't altered if none of the relevant datapoints (or a short time horizon) are given.

@danielhuppmann danielhuppmann merged commit 80544f2 into main Apr 10, 2026
6 checks passed
@danielhuppmann danielhuppmann deleted the feature/emissions-diagnostics branch April 10, 2026 15:30
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