Skip to content

Improve aluminum model #345

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

Merged
merged 22 commits into from
May 14, 2025
Merged

Improve aluminum model #345

merged 22 commits into from
May 14, 2025

Conversation

macflo8
Copy link
Contributor

@macflo8 macflo8 commented May 12, 2025

This PR adds the improvements of the aluminum sector representation in MESSAGEix-Materials developed in the course of the ScenarioMIP project. It cherry-picks some initial commits from the #235 branch.

How to review

  • Read the diff and note that the CI checks all pass.
  • Run MESSAGEix-Materials build and check if it runs successfully
  • Look at the materials doc in the ReadTheDocs preview build of the documentation.
  • Ensure that changes/additions are self-documenting, i.e. that another
    developer (someone like the reviewer) will be able to understand what the code
    does in the future.

PR checklist

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

@macflo8 macflo8 self-assigned this May 12, 2025
@macflo8 macflo8 added the material MESSAGEix-Materials variant label May 12, 2025
@khaeru
Copy link
Member

khaeru commented May 12, 2025

Thanks @macflo8!

The error message on CI is a little opaque, but I believe it occurs because one of the added/modified files wants to import .material.data_other_industry that is missing from not yet included in the PR.

@macflo8
Copy link
Contributor Author

macflo8 commented May 12, 2025

Yes, good catch. I had a conflict during rebasing and did not merge correctly it seems. I will try to repeat the step and clean that up.

@macflo8 macflo8 force-pushed the ssp-dev-aluminum-pr branch from 90f82ff to 9f744c6 Compare May 12, 2025 13:19
Copy link

codecov bot commented May 12, 2025

Codecov Report

Attention: Patch coverage is 89.89547% with 29 lines in your changes missing coverage. Please review.

Project coverage is 73.4%. Comparing base (a7c26bd) to head (c4ce855).
Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
message_ix_models/model/material/data_aluminum.py 92.4% 17 Missing ⚠️
message_ix_models/model/material/build.py 0.0% 6 Missing ⚠️
message_ix_models/model/material/data_util.py 50.0% 6 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (a7c26bd) and HEAD (c4ce855). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (a7c26bd) HEAD (c4ce855)
16 15
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #345     +/-   ##
=======================================
- Coverage   78.6%   73.4%   -5.3%     
=======================================
  Files        219     220      +1     
  Lines      17499   17746    +247     
=======================================
- Hits       13766   13034    -732     
- Misses      3733    4712    +979     
Files with missing lines Coverage Δ
message_ix_models/model/material/data_generic.py 14.9% <ø> (-83.6%) ⬇️
message_ix_models/model/material/data_petro.py 11.1% <ø> (-67.8%) ⬇️
message_ix_models/model/material/util.py 58.5% <100.0%> (+14.6%) ⬆️
...ssage_ix_models/tests/model/material/test_build.py 92.3% <ø> (-3.9%) ⬇️
..._models/tests/model/material/test_data_aluminum.py 100.0% <100.0%> (ø)
message_ix_models/model/material/build.py 54.7% <0.0%> (-13.2%) ⬇️
message_ix_models/model/material/data_util.py 12.9% <50.0%> (-20.5%) ⬇️
message_ix_models/model/material/data_aluminum.py 93.4% <92.4%> (+1.8%) ⬆️

... and 13 files with indirect coverage changes

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

@macflo8 macflo8 force-pushed the ssp-dev-aluminum-pr branch from 07c1458 to a62e0e0 Compare May 13, 2025 12:19
@khaeru khaeru force-pushed the ssp-dev-aluminum-pr branch from a62e0e0 to ae03a7c Compare May 13, 2025 14:11
khaeru added a commit that referenced this pull request May 13, 2025
macflo8 and others added 20 commits May 14, 2025 08:27
Remove rows where year_vtg - year_act is greater than the longest
lifetime
- Move SSP differentiated parameters from input data to functions
- Remove duplicated input files for SSPs
- Change input data format from xlsx to csv
- Move unformatted data files into subdirectory
- Move SSP differentiated parameters from input data to functions
- Remove duplicated input files for SSPs
- Change input data format from xlsx to csv
- Move unformatted data files into subdirectory
@khaeru khaeru marked this pull request as ready for review May 14, 2025 06:28
Copy link
Member

@khaeru khaeru left a comment

Choose a reason for hiding this comment

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

Thanks @macflo8 for the work and collaboration here!

All checks are passing (except one, see below), so approved.

Just to recap some points we discussed for follow-up:

  • We accept the drop in coverage for the time being—to be addressed in a follow-up PR after other material pieces are on main.
  • Fetch aluminum data from upstream sources #348
  • We can investigate how to replace .material.util.read_config() with a Config class, to avoid the Context.get_instance(-1) call that seems fragile on GitHub Actions/in the test suite. This should in turn allow to remove the one XFAIL test mark added in this PR.

I will now:

@khaeru khaeru force-pushed the ssp-dev-aluminum-pr branch from 152507c to c4ce855 Compare May 14, 2025 06:32
@khaeru khaeru merged commit 7a999bc into main May 14, 2025
7 of 23 checks passed
@khaeru khaeru deleted the ssp-dev-aluminum-pr branch May 14, 2025 06:34
@khaeru khaeru added enh New features or functionality p:SSP-2024 2024 SSP updates and ScenarioMIP labels May 14, 2025
@khaeru khaeru added this to the 2025-06 milestone May 28, 2025
khaeru added a commit that referenced this pull request May 28, 2025
khaeru added a commit that referenced this pull request May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New features or functionality material MESSAGEix-Materials variant p:SSP-2024 2024 SSP updates and ScenarioMIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants