We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e40743 commit f7fd0b6Copy full SHA for f7fd0b6
message_ix_models/model/transport/files.py
@@ -559,7 +559,6 @@ def read_structures() -> "sdmx.message.StructureMessage":
559
key="population suburb share:n-y:exo",
560
name="Share of MSA population that is suburban",
561
units="dimensionless",
562
- required=False,
563
)
564
565
speed = add(
message_ix_models/model/transport/ldv.py
@@ -299,7 +299,7 @@ def prepare_tech_econ(
299
300
# Create base quantity for "output" parameter
301
nty = tuple("nty")
302
- c.add(k.output[0] * nty, wildcard(1.0, "", nty))
+ c.add(k.output[0] * nty, wildcard(1.0, "Gv km", nty))
303
for i, coords in enumerate(["n::ex world", "t::LDV", "y::model"]):
304
c.add(
305
k.output[i + 1] * nty,
message_ix_models/tests/model/transport/test_build.py
@@ -276,14 +276,14 @@ def test_build_existing(tmp_path, test_context, url, solve=False):
276
@pytest.mark.parametrize(
277
"build_kw",
278
(
279
- dict(regions="R11", years="A", options=dict()),
280
- dict(regions="R11", years="B", options=dict()),
+ dict(regions="R11", years="A"),
+ dict(regions="R11", years="B"),
281
dict(regions="R11", years="B", options=dict(futures_scenario="A---")),
282
dict(regions="R11", years="B", options=dict(futures_scenario="debug")),
283
- dict(regions="R12", years="B", options=dict()),
+ dict(regions="R12", years="B"),
284
dict(regions="R12", years="B", options=dict(navigate_scenario="act+ele+tec")),
285
- dict(regions="R14", years="B", options=dict()),
286
- param(dict(regions="ISR", years="A", options=dict()), marks=MARK[3]),
+ param(dict(regions="R14", years="B"), marks=MARK[0]),
+ param(dict(regions="ISR", years="A"), marks=MARK[3]),
287
),
288
289
def test_debug(
message_ix_models/tests/model/transport/test_data.py
@@ -2,7 +2,7 @@
2
import pytest
3
from iam_units import registry
4
5
-from message_ix_models.model.transport import build, testing
+from message_ix_models.model.transport import build, non_ldv, testing
6
from message_ix_models.model.transport.CHN_IND import get_chn_ind_data, get_chn_ind_pop
7
from message_ix_models.model.transport.roadmap import get_roadmap_data
8
from message_ix_models.model.transport.testing import MARK, assert_units, make_mark
@@ -73,7 +73,7 @@ def test_get_non_ldv_data(test_context, regions, years="B"):
73
c, _ = testing.configure_build(ctx, regions=regions, years=years)
74
75
# Code runs
76
- data = c.get("transport nonldv::ixmp")
+ data = c.get(f"transport{non_ldv.Pi}")
77
78
# Data are provided for the these parameters
79
exp_pars = {
message_ix_models/tests/model/transport/test_ldv.py
@@ -80,6 +80,9 @@ def test_get_ldv_data(tmp_path, test_context, dummy_LDV, regions, years) -> None
80
81
82
# Output data is returned and has the correct units
83
+ # for k, df_group in data["output"].groupby("unit"):
84
+ # if k == "": # DEBUG Show data with particular units
85
+ # print(df_group.to_string())
86
assert {"Gp km", "Gv km", "Gv * km", "km", "-"} >= set(
87
data["output"]["unit"].unique()
88
message_ix_models/tests/project/ssp/test_transport.py
@@ -152,7 +152,7 @@ def test_cli(tmp_path, mix_models_cli, input_xlsx_path) -> None:
152
copyfile(input_file, path_in)
153
154
155
- result = mix_models_cli.invoke(["ssp", "transport", f"{path_in}"])
+ result = mix_models_cli.invoke(["ssp", "transport", "--method=A", f"{path_in}"])
156
assert 0 == result.exit_code, result.output
157
158
# Output path was determined automatically and exists
0 commit comments