Skip to content

Commit

Permalink
Add general report key "all::iamc"
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Apr 19, 2024
1 parent 357fa7e commit a7ef3f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions message_ix_models/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ def prepare_reporter(
)
rep.configure(model=deepcopy(context.model))

# Add a placeholder task to concatenate IAMC-structured data
rep.add("all::iamc", "concat")

# Apply callbacks for other modules which define additional reporting computations
for callback in chain(CALLBACKS, context.report.iter_callbacks()):
callback(rep, context)
Expand Down
4 changes: 4 additions & 0 deletions message_ix_models/report/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ def full(name: str) -> Key:
info = dict(variable="transport emissions", base=k1.drop("h", "m", "yv"), var=[var])
iamc(rep, info)

# Append to the "all::iamc" task
# TODO Use a helper function for this
rep.graph["all::iamc"] += ("transport emissions::iamc",)

# TODO use store_ts() to store on scenario

log.info(f"Added {len(rep.graph) - N} keys")

0 comments on commit a7ef3f5

Please sign in to comment.