Skip to content

Rework of REMIND climate assessment integration - Reporting - #2082

Merged
tonnrueter merged 8 commits into
remindmodel:developfrom
tonnrueter:dev/ca_rework_pt1
Apr 11, 2025
Merged

Rework of REMIND climate assessment integration - Reporting#2082
tonnrueter merged 8 commits into
remindmodel:developfrom
tonnrueter:dev/ca_rework_pt1

Conversation

@tonnrueter

@tonnrueter tonnrueter commented Apr 8, 2025

Copy link
Copy Markdown
Contributor

Purpose of this PR

First part of the reworking the REMIND climate assessment integration. Affects climate reporting via MAGICC7_AR6.R

  • Script has been consolidated using the remindClimateAssessment and piamenv packages

  • Python environment handling is done by piamenv::condaInit and piamenv::condaRun

    • Move towards conda run-based Python integration. This alleviates interference between R and Python environments
    • Init commands allow fine grained control of conda env activation
    • Only drawback so far in the new implementation is that logs are not printed linewise but dumped all at once
    • TODO (in a later PR): Archive Python run environment
    • TODO (in a later PR): Adapt scripts/input/climate_assessment_*.R to piamenv/remindClimateAssessment usage
  • remindClimateAssessment handles all aspects of setting up runs of IIASA's climate-assessment library

    • Features a configuration concept that absorbs the previously tedious file name record keeping. List climateAssessmentConfig contains all directories and file names relevant to set up a climate assessment run
    • Run time reporting for various parts of the script was implemented by storing run times in a named vector. reportRunTimes generates a report and attaches it to the log file
    • Write climate assessment parameters to gdx via remindClimateAssessment::dumpToGdx
    • Relies on config files to associate climate assessment variables. gdx filenames and REMIND/GAMS variables names
    • remindClimateAssessment::archiveClimateAssessmentData stores climate assessment data of a particular run in a tar archive

Type of change

Indicate the items relevant for your PR by replacing ◻️ with ☑️.
Do not delete any lines. This makes it easier to understand which areas are affected by your changes and which are not.

Parts concerned

  • ◻️ GAMS Code
  • ☑️ R-scripts
  • ☑️ Documentation (GAMS incode documentation, comments, tutorials)
  • ◻️ Input data / CES parameters
  • ◻️ Tests, CI/CD (continuous integration/deployment)
  • ◻️ Other (please give a description)

Impact

  • ◻️ Bug fix
  • ☑️ Refactoring
  • ◻️ New feature
  • ◻️ Change of parameter values or input data (including CES parameters)
  • ◻️ Minor change (default scenarios show only small differences)
  • ◻️ Fundamental change of results of default scenarios

Checklist

Do not delete any line. Leave unfinished elements unchecked so others know how far along you are.
In the end all checkboxes must be ticked before you can merge
.

  • I executed the automated model tests (make test) after my final commit and all tests pass (FAIL 0)
  • I adjusted the reporting in remind2 if and where it was needed
  • My code follows the coding etiquette
  • I explained my changes within the PR, particularly in hard-to-understand areas
  • I checked that the in-code documentation is up-to-date
  • I adjusted forbiddenColumnNames in readCheckScenarioConfig.R in case the PR leads to deprecated switches
  • I updated the CHANGELOG.md correctly (added, changed, fixed, removed, input data/calibration)

Further information (optional)

  • Runs with these changes are here:
    • /p/tmp/tonnru/remind/output/SSP2-NPi2025_2025-04-04_19.32.43
  • Comparison of results (what changes by this PR?):

Tonn Rüter added 6 commits April 8, 2025 19:32
- The climate reporting script `MAGICC7_AR6.R` was has been consolidated using the `remindClimateAssessment` and `piamenv` packages
- List `climateAssessmentConfig` contains all directories and file names relevant to set up a climate assessment run
- Python environment handling is done by `piamenv::condaInit` and `piamenv::condaRun`
  - One drawback in the new implementation is that logs are *not printed linewise* but dumped all at once
- Run time reporting for various parts of the script was implemented by storing run times in a named vector. `reportRunTimes` generates a report and attaches it to the log file
- Moved pre-/post-processing into dedicated functions
- Restructured script
@tonnrueter

Copy link
Copy Markdown
Contributor Author

check.yaml fails with

remindClimateAssessment: Can't find package called remindClimateAssessment.

We need to add remindClimateAssessment to the PIAM CRAN

Comment thread CHANGELOG.md Outdated

@gabriel-abrahao gabriel-abrahao 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.

That is awesome, thanks for the great work Tonn!

@tonnrueter tonnrueter changed the title Rework of REMIND climate assessment intergration - Reporting Rework of REMIND climate assessment integration - Reporting Apr 11, 2025
@tonnrueter
tonnrueter merged commit 4606d11 into remindmodel:develop Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants