Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transport improvements from 2024-W49 #259

Draft
wants to merge 45 commits into
base: main
Choose a base branch
from
Draft

Transport improvements from 2024-W49 #259

wants to merge 45 commits into from

Conversation

khaeru
Copy link
Member

@khaeru khaeru commented Dec 3, 2024

  • Items for SSP 2024/ScenarioMIP.
    • Update base scenario URLs from e.g. ixmp://ixmp-dev/SSP_dev_SSP1_v0.1_Blv0.18/baseline_prep_lu_bkp_solved_materials to e.g. ixmp://ixmp-dev/SSP_SSP1_v1.1/baseline_DEFAULT_step_13.
    • Constrain t=conm_ar (a P AIR technology) to a low/zero share in 2020. This technology was (a) taking a large share in y=2020 without constraints and (b) because not present at all in IEA EWEB for some regions, was being scaled with 1.0, so passing through as a large value.
    • Use a smaller growth_activity_up value for (t=ICAm_ptrp, n=R12_RCPA). The technology constraint as of 2020 is effective, but this tech/region grows too rapidly to 2025 and beyond. (per discussion with @r-aneeque 2024-12-04.)
    • Adjust efficiencies of LDV PHEV technologies using duty cycle data.
    • Ensure growth_activity_up and act-non_ldv.csv values are set for F ROAD technologies with, at least, c=gas inputs. This is to avoid the behaviour (observed by @r-aneeque) that the model quickly switches into these in 2025–2030. Rework .transport.Config.constraint to simplify the setting of these constraints.
  • Items for aviation emissions postprocessing:

This branch is currently triggering the message_data transport runs using iiasa/message_data#582, which limits to a subset of all scenarios.

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 transport MESSAGEix-Transport variant or transport in the base model p:SSP-2024 2024 SSP updates and ScenarioMIP labels Dec 3, 2024
@khaeru khaeru self-assigned this Dec 3, 2024
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 93.86792% with 13 lines in your changes missing coverage. Please review.

Project coverage is 76.7%. Comparing base (29ec892) to head (d384ef5).

Files with missing lines Patch % Lines
...sage_ix_models/tests/model/transport/test_build.py 51.8% 13 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #259     +/-   ##
=======================================
- Coverage   77.6%   76.7%   -1.0%     
=======================================
  Files        211     211             
  Lines      16108   16108             
=======================================
- Hits       12511   12363    -148     
- Misses      3597    3745    +148     
Files with missing lines Coverage Δ
message_ix_models/model/transport/build.py 95.3% <100.0%> (ø)
message_ix_models/model/transport/config.py 97.6% <100.0%> (ø)
message_ix_models/model/transport/demand.py 98.5% <ø> (ø)
message_ix_models/model/transport/files.py 98.6% <100.0%> (ø)
message_ix_models/model/transport/freight.py 100.0% <100.0%> (ø)
message_ix_models/model/transport/ldv.py 96.7% <100.0%> (ø)
message_ix_models/model/transport/non_ldv.py 98.1% <100.0%> (ø)
message_ix_models/model/transport/operator.py 86.8% <100.0%> (ø)
message_ix_models/model/transport/structure.py 90.3% <100.0%> (ø)
message_ix_models/model/transport/testing.py 100.0% <ø> (ø)
... and 11 more

... and 6 files with indirect coverage changes

@khaeru khaeru force-pushed the transport/2024-W49 branch 6 times, most recently from e0e1fb6 to 8967c53 Compare December 5, 2024 13:40
@khaeru khaeru force-pushed the transport/2024-W49 branch from 3c9192d to b1f411e Compare December 17, 2024 10:03
@khaeru khaeru force-pushed the transport/2024-W49 branch from 2a9f63c to 202c41c Compare January 14, 2025 11:57
@khaeru khaeru force-pushed the transport/2024-W49 branch 3 times, most recently from c7edf92 to f1d40c4 Compare January 24, 2025 17:29
khaeru added 15 commits January 24, 2025 18:30
- Only write the file if it is different from a refreshed codelist.
- Use ScenarioCodeAnnotations class.
- Add Config.use_scenario_code()
- Update base scenario URLs.
Replace with annotations in CL_TRANSPORT_SCENARIO.
This commodity is not used in IEA EWEB 2024 data for 2019, so we
constrain its activity to a low, non-zero level.
Mirror calculation flow in .ldv for same parameter.
"output" for most technologies is dimensionless because ACT and the
output commodities have the same units.
khaeru and others added 29 commits January 24, 2025 18:30
- Use .testing.check features to simplify list of assertions/debug output.
- Add the same set of cases as .test_demand.test_exo.
Include all assertions in .test_build.CHECKS
…instead of "input" parameter values.
Use (regions=R12, years=B) to match 'main' model version.
Resolve infeasibilities with updated base model.
purely based on very high 2025 demand numbers that are unrealistic
purely based on very high 2025 demand numbers that are unrealistic. Aviation adjustment based on scale-1
based on scale-1 and high 2025 values
based on scale 1 and 2025 values (AIR is too high and demand is too high as well)
Remove values for:
  - R12_AFR, ROAD, ethanol
  - R12_FSU, ROAD, electr
  - R12_LAM, ROAD, gas
  - R12_MEA, RAIL, lightoil
  - R12_PAO, ROAD, gas
  - R12_RCPA, RAIL, lightoil
  - R12_RCPA, ROAD, gas
- Add values for:
  - R12_AFR, RAIL, lightoil
  - R12_CHN, ROAD, electr
  - R12_NAM, RAIL, lightoil
  - R12_PAO, ROAD, ethanol
  - R12_RCPA, ROAD, ethanol
  - R12_SAS, ROAD, ethanol
- Adjust all others
- Store context.core.local_data on pytestconfig for reference.
- Add user_local_data fixture for development.
- Sort variables and functions.
- Split main() to prepare_method_A().
- Add main(…, method=…) argument.
- Add stub prepare_method_B().
- Separate STRUCTURE_STATIC and use Computer.add_queue() for clarity.
- Add docstrings listing all added keys/tasks.
- Move function to .operator.write_report_debug().
@khaeru khaeru force-pushed the transport/2024-W49 branch from f1d40c4 to d384ef5 Compare January 24, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:SSP-2024 2024 SSP updates and ScenarioMIP 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