Skip to content

Commit

Permalink
Copy "output" anno from F {RAIL,ROAD} to children
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Dec 4, 2024
1 parent 0b87ecf commit 498ab8f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions message_ix_models/model/transport/structure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from collections.abc import Sequence
from copy import deepcopy
from typing import Any, Union

from sdmx.model.common import Annotation, Code
Expand Down Expand Up @@ -109,6 +110,12 @@ def make_spec(regions: str) -> Spec:
output = dict(commodity=f"transport vehicle {t.id}", level="useful")
t.annotations.append(Annotation(id="output", text=repr(output)))

# Associate other techs with their output commodities
for mode in "F RAIL", "F ROAD":
parent = techs[techs.index(mode)]
for t in parent.child:
t.annotations.append(deepcopy(parent.get_annotation(id="output")))

# Generate a spec for the generalized disutility formulation for LDVs
s2 = disutility.get_spec(
groups=s.add.set["consumer_group"], technologies=LDV_techs, template=TEMPLATE
Expand Down

0 comments on commit 498ab8f

Please sign in to comment.