Skip to content

Commit

Permalink
Rename TYPE concept, code list, and dimensions to SERVICE
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Feb 19, 2021
1 parent 856a2ec commit 70bf8d0
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions item/sdmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def generate() -> msg.StructureMessage:
)
for order, concept_id in enumerate(
(
"TYPE MODE VEHICLE FUEL TECHNOLOGY AUTOMATION OPERATOR POLLUTANT LCA_SCOPE "
"FLEET"
"SERVICE MODE VEHICLE FUEL TECHNOLOGY AUTOMATION OPERATOR POLLUTANT "
"LCA_SCOPE FLEET"
).split()
):
concept = sm.concept_scheme["TRANSPORT"][concept_id]
Expand Down Expand Up @@ -123,7 +123,11 @@ def generate() -> msg.StructureMessage:
"TRANSPORT": (
# Used as dimensions
Concept(
id="TYPE", name="Objects being transported, e.g. passengers or freight"
id="SERVICE",
name="Service",
description=(
"Type of transport service e.g. transport of passengers or of freight."
),
),
Concept(id="MODE", name="Mode or medium of transport"),
Concept(
Expand Down Expand Up @@ -177,8 +181,8 @@ def generate() -> msg.StructureMessage:
),
**_units(
{
"TYPE == passenger": "10⁹ passenger-km / yr",
"TYPE == freight": "10⁹ tonne-km / yr",
"SERVICE == passenger": "10⁹ passenger-km / yr",
"SERVICE == freight": "10⁹ tonne-km / yr",
# TODO distinguish "10⁹ vehicle-km / yr"
}
),
Expand Down Expand Up @@ -211,8 +215,8 @@ def generate() -> msg.StructureMessage:
description="Amount of activity provided per vehicle",
**_units(
{
"TYPE == PASSENGER": "passenger / vehicle",
"TYPE == FREIGHT": "tonne / vehicle",
"SERVICE == PASSENGER": "passenger / vehicle",
"SERVICE == FREIGHT": "tonne / vehicle",
}
),
),
Expand Down Expand Up @@ -371,7 +375,7 @@ def generate() -> msg.StructureMessage:
),
)

CL_TYPE = (
CL_SERVICE = (
Code(id="P", name="Passenger"),
Code(id="F", name="Freight"),
)
Expand All @@ -397,6 +401,6 @@ def generate() -> msg.StructureMessage:
"MODE": CL_MODE,
"OPERATOR": CL_OPERATOR,
"POLLUTANT": CL_POLLUTANT,
"TYPE": CL_TYPE,
"SERVICE": CL_SERVICE,
"VEHICLE": CL_VEHICLE,
}

0 comments on commit 70bf8d0

Please sign in to comment.