Skip to content

Transport improvements for 2026-W04#471

Merged
khaeru merged 73 commits into
mainfrom
transport/2026-w04
Apr 15, 2026
Merged

Transport improvements for 2026-W04#471
khaeru merged 73 commits into
mainfrom
transport/2026-w04

Conversation

@khaeru

@khaeru khaeru commented Jan 28, 2026

Copy link
Copy Markdown
Member

#447 ← previous PR | following PR → #497

MESSAGEix-Transport itself:

  • Switch non-LDV technologies to the same stock representation used for LDVs.
  • Reporting
    • Expand reporting output to include stock and sales of non-LDV vehicles.
    • Adjust reporting labels for non-LDV technologies.
  • Transfer placeholder data for parameters of non-LDV vehicles from SharePoint folder. Next PR.

Materials-Transport integration:

  • Add missing units "Mt / Mv" to platform/build.
  • Direct output_cap_new to level=end_of_life.
  • Add a ratio between input_cap_new and output_cap_ret, representing a portion of the materials for each vehicle type that is non-recyclable.
    • Currently this is a fixed, scalar value.
  • Expand transport reporting with material inflows, outflows per technology and technology groups. Next PR.

For CircEUlar:

  • Add a distinct workflow to build, solve, and report these scenarios.
    • CLI entry-point for this workflow.
    • Reuse transport workflow steps.
  • Complete iiasa/message_data#622.
  • Invoke the workflow via CI or on UniCC, like the MESSAGEix-Transport workflow. Next PR.

For ScenarioMIP:

  • Update base scenario identifiers to v6.5.
  • Retrieve and store price trajectories for 17 scenarios (below)
  • Add these to CL_TRANSPORT_SCENARIO, bump version.
Scenario identifiers
SSP_LED_v6.5 LED - High Emissions 
SSP_LED_v6.5 SSP2 - Very Low Emissions 
SSP_SSP1_v6.5 SSP1 - High Emissions 
SSP_SSP1_v6.5 SSP1 - Low Emissions 
SSP_SSP1_v6.5 SSP1 - Very Low Emissions 
SSP_SSP2_v6.5 SSP2 - High Emissions 
SSP_SSP2_v6.5 SSP2 - Low Overshoot 
SSP_SSP2_v6.6 SSP2 - Medium Emissions
SSP_SSP2_v6.5 SSP2 - Medium-Low Emissions 
SSP_SSP2_v6.5 SSP2 - Low Emissions 
SSP_SSP3_v6.5 SSP3 - High Emissions 
SSP_SSP3_v6.5 SSP3 - Medium-Low Emissions_a 
SSP_SSP4_v6.5 SSP4 - High Emissions 
SSP_SSP4_v6.5 SSP4 - Low Overshoot 
SSP_SSP5_v6.5 SSP5 - High Emissions 
SSP_SSP5_v6.5 SSP5 - Low Overshoot 
SSP_SSP5_v6.5 SSP5 - Medium-Low Emissions_a

How to review

  • Read the diff.
  • Note that the CI checks all pass.

PR checklist

  • Continuous integration checks all ✅
  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation.
  • Update doc/whatsnew.

@khaeru khaeru self-assigned this Jan 28, 2026
@khaeru khaeru requested a review from amastrucci as a code owner January 28, 2026 22:25
@khaeru khaeru added the transport MESSAGEix-Transport variant or transport in the base model label Jan 28, 2026
@khaeru khaeru requested a review from r-aneeque as a code owner January 28, 2026 22:25
@khaeru khaeru added the p:CircEUlar CircEUlar project label Jan 28, 2026
@khaeru khaeru marked this pull request as draft January 28, 2026 22:26
@codecov

codecov Bot commented Jan 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.32541% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.5%. Comparing base (1f7fe08) to head (eb278bc).
⚠️ Report is 74 commits behind head on main.

Files with missing lines Patch % Lines
message_ix_models/model/transport/structure.py 84.2% 6 Missing ⚠️
message_ix_models/cli.py 0.0% 2 Missing ⚠️
message_ix_models/model/workflow.py 92.8% 2 Missing ⚠️
message_ix_models/report/operator.py 80.0% 2 Missing ⚠️
message_ix_models/testing/check.py 87.5% 2 Missing ⚠️
message_ix_models/model/transport/build.py 96.7% 1 Missing ⚠️
message_ix_models/model/transport/config.py 95.4% 1 Missing ⚠️
message_ix_models/model/transport/operator.py 50.0% 1 Missing ⚠️
message_ix_models/util/config.py 94.4% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #471     +/-   ##
=======================================
+ Coverage   73.3%   73.5%   +0.1%     
=======================================
  Files        301     305      +4     
  Lines      24429   24660    +231     
=======================================
+ Hits       17914   18127    +213     
- Misses      6515    6533     +18     
Files with missing lines Coverage Δ
message_ix_models/model/transport/base.py 94.1% <100.0%> (-0.1%) ⬇️
message_ix_models/model/transport/check.py 97.8% <ø> (ø)
message_ix_models/model/transport/cli.py 54.7% <100.0%> (+0.8%) ⬆️
message_ix_models/model/transport/constraint.py 100.0% <100.0%> (ø)
message_ix_models/model/transport/data.py 98.1% <100.0%> (-0.8%) ⬇️
message_ix_models/model/transport/demand.py 100.0% <100.0%> (ø)
message_ix_models/model/transport/disutility.py 100.0% <100.0%> (ø)
message_ix_models/model/transport/factor.py 87.9% <100.0%> (ø)
message_ix_models/model/transport/freight.py 100.0% <100.0%> (ø)
message_ix_models/model/transport/groups.py 97.0% <100.0%> (ø)
... and 48 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@khaeru khaeru force-pushed the transport/2026-w04 branch from 7d00b39 to 76f1a1d Compare February 4, 2026 20:12
@khaeru khaeru force-pushed the transport/2026-w04 branch from 76f1a1d to c090764 Compare February 4, 2026 20:21
@khaeru khaeru force-pushed the transport/2026-w04 branch from c090764 to baca824 Compare February 4, 2026 22:59
@khaeru khaeru force-pushed the transport/2026-w04 branch from baca824 to 8a2d882 Compare February 5, 2026 14:31
@khaeru khaeru force-pushed the transport/2026-w04 branch from 8a2d882 to 935f8f6 Compare February 6, 2026 09:01
@khaeru khaeru force-pushed the transport/2026-w04 branch from 935f8f6 to 9514363 Compare February 6, 2026 13:23
@khaeru khaeru force-pushed the transport/2026-w04 branch from 9514363 to 3715382 Compare February 6, 2026 15:00
khaeru added a commit that referenced this pull request Feb 16, 2026
- Adjust condition for material build tests to enable.
- Add check of demand quantity.
- Remove XFAIL mark on test_debug case with extra_modules=["material"].
@khaeru khaeru force-pushed the transport/2026-w04 branch from 2e7eadf to ffdc3b0 Compare February 16, 2026 11:31
khaeru added 25 commits April 15, 2026 12:09
- Omit non-dataclass members of __dict__, such as "__weakref__", from
  ._fields()
- Rename ._munge_dict() → ._canonicalize().
- Accept an Exception subclass instead of fail="raise" string.
- Add __iter__ as a helper for .update().
- Use ._canonicalize() in .update().
- Accept a single positional arg to .update().
- Drop unused .read_file(…, fail=…) kwarg.
- Adjust, simplify, and type hint tests.
- Move IAMC-related configuration into convert_iamc() setup function.
- Preserve expected output per test_report.test_compare().
- Rename some old "report" annotations to "message-v-id:".
- Add names and "report" annotations for many more technologies.
  - Include mode prefixes.
- Change "Transport|Stock|" variable prefix to "Stocks|Transportation|",
  likewise sales.
- Adjust test.
- Increase base model version from v6.1 to v6.5 or v6.6.
- Add additional "exo price" cases for #271.
- Simplify _append_codes() helper.
- Improve docstrings.
- Update test expectation of code count.
- Migrate and generalize from .transport.report.add_iamc_store_write().
- Adjust usage.
- Align and share code with get_technology_groups().
- Update docstrings.
- Add tests.
.agg, .c, .coord, .t
- Add .structure.get_commodity_groups().
- Harmonize addition of structural information for groups, including
  keys; apply to both commodity and technology.
- Use "from . import key as K" style consistently.
- Remove separate functions aggregate(), reapply_units(),
  select_transport_techs() in favour of fewer/generalized tasks.
- Rename SELECT to QUANTITY.
- Apply operations consistently to all QUANTITY.
- Add UNIT global.
- Adjust key references in .transport.{base,data}.
- Improve docstrings.

@r-aneeque r-aneeque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@khaeru

khaeru commented Apr 15, 2026

Copy link
Copy Markdown
Member Author

The one failing job is due to network errors accessing a remote server:

ERROR message_ix_models/tests/tools/test_wb.py::test_get_income_group_codelist
ERROR message_ix_models/tests/tools/test_wb.py::test_assign_income_groups[R12-population-None]
ERROR message_ix_models/tests/tools/test_wb.py::test_assign_income_groups[R12-count-None]
ERROR message_ix_models/tests/tools/test_wb.py::test_assign_income_groups[R12-population-0] - requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.worldbank.org', port=443): Max retries exceeded with url: /v2/sdmx/rest/codelist/WB/ (Caused by NameResolutionError("HTTPSConnection(host='api.worldbank.org', port=443): Failed to resolve 'api.worldbank.org' ([Errno 8] nodename nor servname provided, or not known)"))

Since these are transient and don't affect other jobs, I'll merge without waiting for this job to re-run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p:CircEUlar CircEUlar project transport MESSAGEix-Transport variant or transport in the base model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants