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

Merged
merged 42 commits into from
Jan 28, 2025
Merged

Transport improvements from 2024-W49 #259

merged 42 commits into from
Jan 28, 2025

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.
    • [ ] Next PR: 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.)
    • [ ] Next PR: Adjust efficiencies of LDV PHEV technologies using duty cycle data.
    • [ ] Next PR: 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 was temporarily triggering the message_data transport runs using iiasa/message_data#582, which limits to a subset of all scenarios.

How to review

Per aviation emissions:

  • View the diff (click 'Files changed' above), particularly the file message_ix_models/data/transport/emi-intensity.csv.
  • View the preview build of the documentation, in particular the page “Shared Socioeconomic Pathways (project.ssp)” and section “2024 update > transport”, here.
  • Confirm the code runs without error on the files in ECE SharePoint > Documents > SharedSocioeconomicPathways2023 > Scenario_Vetting (for instance, the subdirectory v2.1_Internal_version_Dec13_2024 > Reporting_output.
  • View the output and note any qualitative or quantitative issues to be resolved.

More 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 94.42231% with 14 lines in your changes missing coverage. Please review.

Project coverage is 76.7%. Comparing base (29ec892) to head (3c589c0).
Report is 43 commits behind head on main.

Files with missing lines Patch % Lines
...sage_ix_models/tests/model/transport/test_build.py 51.8% 13 Missing ⚠️
message_ix_models/model/transport/files.py 88.8% 1 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/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% <ø> (ø)
message_ix_models/model/transport/workflow.py 80.7% <100.0%> (ø)
... and 12 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 5 times, most recently from d384ef5 to a6022ee Compare January 28, 2025 08:39
khaeru added 13 commits January 28, 2025 09:44
- 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.
r-aneeque and others added 15 commits January 28, 2025 09:44
- R12_MEA reduction purely based on very high 2025 demand numbers that are
  unrealistic.
- R12_WEU to match 2019-based estimates.
- R12_MEA purely based on very high 2025 demand numbers that are unrealistic.
  Aviation adjustment based on scale-1.
- R12_MEA based on scale-1 and high 2025 values.
- R12_SAS 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 a6022ee to 2acaf26 Compare January 28, 2025 08:48
@khaeru khaeru marked this pull request as ready for review January 28, 2025 08:48
@khaeru khaeru requested a review from r-aneeque as a code owner January 28, 2025 08:48
@khaeru
Copy link
Member Author

khaeru commented Jan 28, 2025

Will merge without code owner review from @r-aneeque, as he's on annual leave.

@khaeru khaeru merged commit 08dc7fc into main Jan 28, 2025
31 checks passed
@khaeru khaeru deleted the transport/2024-W49 branch January 28, 2025 17:10
khaeru added a commit that referenced this pull request Jan 29, 2025
- Set units for 'output' param in .ldv.prepare_tech_econ().
- .transport.files.population_suburb_share is required.
khaeru added a commit that referenced this pull request Jan 29, 2025
- Set units for 'output' param in .ldv.prepare_tech_econ().
- .transport.files.population_suburb_share is required.
khaeru added a commit that referenced this pull request Jan 29, 2025
- Set units for 'output' param in .ldv.prepare_tech_econ().
khaeru added a commit that referenced this pull request Jan 29, 2025
- Set units for 'output' param in .ldv.prepare_tech_econ().
khaeru added a commit that referenced this pull request Jan 29, 2025
- Set units for 'output' param in .ldv.prepare_tech_econ().
@khaeru khaeru mentioned this pull request Jan 29, 2025
9 tasks
khaeru added a commit that referenced this pull request Jan 31, 2025
- Set units for 'output' param in .ldv.prepare_tech_econ().
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