Skip to content

Transport improvements for 2026-W16#497

Draft
khaeru wants to merge 61 commits into
mainfrom
transport/2026-w16
Draft

Transport improvements for 2026-W16#497
khaeru wants to merge 61 commits into
mainfrom
transport/2026-w16

Conversation

@khaeru

@khaeru khaeru commented Apr 15, 2026

Copy link
Copy Markdown
Member

#471 ← previous PR | following PR → (none yet)

MESSAGEix-Transport itself:

Materials-Transport integration / CircEUlar project

Housekeeping/other items
  • Simplify definition and use of pytest marks across the test suite.

  • Add a new pytest mark "ci_linux_only" and apply it to some of the slowest tests.
    This mark skips these tests on Windows and macOS, which are typically the slowest jobs. Compare jobs A and B:

    • ubuntu-latest A: 18–30 minutes. B: 21–30 minutes.
    • macos-latest A: 27–109 minutes. B: 15–55 minutes.
    • windows-latest A: 23–45 minutes. B: 13–25 minutes.

    The marked tests include 18 of the 20 slowest:

    426.27s call     message_ix_models/tests/model/transport/test_report.py::test_bare[R12-B]
    339.51s call     message_ix_models/tests/model/transport/test_build.py::test_bare_res[R12-B-False-IKARUS-True]
    298.29s call     message_ix_models/tests/model/transport/test_report.py::test_simulated[True]
    82.38s call     message_ix_models/tests/tools/costs/test_projections.py::test_ccs_costs[MODULE.cooling]
    78.81s call     message_ix_models/tests/tools/costs/test_projections.py::test_ccs_costs[MODULE.materials]
    67.77s call     message_ix_models/tests/model/transport/test_build.py::test_debug[R12-B-options5]
    66.30s call     message_ix_models/tests/model/transport/test_build.py::test_debug[R12-B-options3]
    66.24s call     message_ix_models/tests/model/transport/test_build.py::test_debug[R12-B-options0]
    63.59s call     message_ix_models/tests/model/transport/test_build.py::test_debug[R12-B-options4]
    63.32s call     message_ix_models/tests/model/transport/test_build.py::test_debug[R12-B-options2]
    59.33s call     message_ix_models/tests/tools/costs/test_projections.py::test_bare_res[R11]
    59.24s call     message_ix_models/tests/model/transport/test_build.py::test_debug[R12-B-options6]
    59.02s call     message_ix_models/tests/model/transport/test_build.py::test_debug[R12-B-options1]
    51.05s call     message_ix_models/tests/tools/costs/test_projections.py::test_bare_res[R12]
    43.10s call     message_ix_models/tests/model/transport/test_report.py::test_simulated[False]
    40.31s call     message_ix_models/tests/tools/costs/test_projections.py::test_ccs_costs[MODULE.energy]
    40.30s call     message_ix_models/tests/tools/costs/test_projections.py::test_ccs_costs[MODULE.dac]
    

How to review

TBA

PR checklist

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

@khaeru khaeru added this to the 2026-05 milestone Apr 15, 2026
@khaeru khaeru self-assigned this Apr 15, 2026
@khaeru khaeru added enh New features or functionality report genno-based reporting and post-solve processing transport MESSAGEix-Transport variant or transport in the base model labels Apr 15, 2026
@khaeru khaeru mentioned this pull request Apr 15, 2026
16 tasks
@codecov

codecov Bot commented Apr 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.79439% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.7%. Comparing base (583e267) to head (63d32e6).
⚠️ Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
...age_ix_models/tests/model/transport/test_demand.py 86.9% 3 Missing ⚠️
message_ix_models/model/transport/report.py 33.3% 2 Missing ⚠️
message_ix_models/testing/__init__.py 92.5% 2 Missing ⚠️
message_ix_models/model/transport/data.py 96.4% 1 Missing ⚠️
message_ix_models/model/transport/testing.py 80.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #497     +/-   ##
=======================================
- Coverage   74.1%   71.7%   -2.5%     
=======================================
  Files        318     319      +1     
  Lines      25568   25635     +67     
=======================================
- Hits       18966   18399    -567     
- Misses      6602    7236    +634     
Files with missing lines Coverage Δ
message_ix_models/model/transport/build.py 83.6% <100.0%> (-13.3%) ⬇️
message_ix_models/model/transport/check.py 29.7% <ø> (-68.1%) ⬇️
message_ix_models/model/transport/config.py 99.5% <100.0%> (+<0.1%) ⬆️
message_ix_models/model/transport/demand.py 100.0% <ø> (ø)
message_ix_models/model/transport/freight.py 100.0% <100.0%> (ø)
message_ix_models/model/transport/key.py 100.0% <ø> (ø)
message_ix_models/model/transport/ldv.py 100.0% <ø> (+4.0%) ⬆️
message_ix_models/model/transport/vehicle.py 100.0% <100.0%> (ø)
...ssage_ix_models/tests/model/material/test_build.py 91.3% <100.0%> (ø)
...sage_ix_models/tests/model/transport/test_build.py 58.5% <100.0%> (-22.8%) ⬇️
... and 19 more

... and 20 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

khaeru added a commit that referenced this pull request Apr 17, 2026
@khaeru khaeru force-pushed the transport/2026-w16 branch from 73bed45 to 4d5ddb7 Compare April 17, 2026 21:33
khaeru added a commit that referenced this pull request Apr 18, 2026
@khaeru khaeru force-pushed the transport/2026-w16 branch from 4d5ddb7 to 808bc39 Compare April 18, 2026 20:26
khaeru added a commit that referenced this pull request Apr 18, 2026
@khaeru khaeru force-pushed the transport/2026-w16 branch from 808bc39 to 2f6864f Compare April 18, 2026 22:11
khaeru added a commit that referenced this pull request Apr 18, 2026
@khaeru khaeru force-pushed the transport/2026-w16 branch from 2f6864f to 69cca97 Compare April 18, 2026 22:13
khaeru added a commit that referenced this pull request Apr 19, 2026
@khaeru khaeru force-pushed the transport/2026-w16 branch from 69cca97 to bb34756 Compare April 19, 2026 10:11
khaeru added a commit that referenced this pull request Apr 19, 2026
@khaeru khaeru force-pushed the transport/2026-w16 branch from bb34756 to a84399e Compare April 19, 2026 12:32
khaeru and others added 29 commits June 26, 2026 11:45
- Redefine SCENARIO Enum as a URNLookupEnum based on this code list.
Tests in .transport.test_util were associated with the function
.transport.util.configure() that has been replaced by the Config
class.
- Rename transport scenario code list to
  CL_SCENARIO_CIRCEULAR_TRANSPORT; adjust references.
- Add and expand tests.
- Use .util.Substitutions to transform labels.
- Add tests.
The changes include:
Changing scenario names
Adding Non-LDV material intensities
Updated VMI values
Fix Non-LDV lifetime values
Add CircEUlar scenario variations
Changes include
Fix & update Non-LDV values
Add variations for CircEUlar scenarios
Consolidate fuel economy for all vehicles (except RAIL in one file)
Add CircEUlar variations
- Add .transport.material.LABEL_SCENARIO.
- Add tests.
Update to latest labels from VMI
Add third al_extrus aluminum variant
- Ensure that new data in lifetime.csv and activity-vehicle.csv are
  broadcast to scenario labels other than SSPs and LED.
Use for instance "SSP_2024_1" to align with Config.label and LABEL_SUBS,
instead of "SSP(2024).1".
Construct indexers via LABEL_SUBS only once for general use.
Remove code for repeated construction of indexers.
Fix error on R12-CHN & R12-NAM, 
Update BEV & PHEV values based on IEA EV data for years = {2021-2025}
Currently both 166 and 167 are set to 2020. 
This constraint shouldn't be operational at the moment
R12_LAM, PHEV_ptrp, 2025, 0.0608
R12_MEA, ELC_100, 2015, 0.0002144
R12_MEA, ELC_100, 2020, 0.000532
R12_MEA, ELC_100, 2025, 0.0076326

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@r-aneeque FYI here.

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

Labels

enh New features or functionality report genno-based reporting and post-solve processing transport MESSAGEix-Transport variant or transport in the base model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

elasticity-f file does not pick DIGSY scenario values

2 participants