Skip to content

Conversation

@lecfab
Copy link
Contributor

@lecfab lecfab commented Jan 5, 2026

Purpose of this PR

When using specific calibrations, the required gdx and inc is not necessarily available, which causes an error. This PR improves the error message in order to know where to put which filename.
Adapted from this conversation.

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)
  • ◻️ Configuration (switches in main.gms, default.cfg, and scenario_config*.csv files)
  • ◻️ 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
  • I adjusted the madrat packages (mrremind and other packages involved) for input data generation 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)

  • Folder with these changes /p/tmp/fabricel/remindGDXfailure

@lecfab lecfab requested a review from robinhasse January 5, 2026 15:25
@lecfab lecfab self-assigned this Jan 5, 2026
@lecfab lecfab requested a review from dklein-pik January 5, 2026 16:02
Copy link
Contributor

@robinhasse robinhasse left a comment

Choose a reason for hiding this comment

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

Thanks Fabrice, this is very useful. I ran into this so often but is has always been irritating at first.

I was always wondering if REMIND shouldn't be able to also copy the file automatically if the users hasn't done that and just throw a warning that - say default SSP2 - has been used as a starting point for the missing calibration scenario.

But this would require more implementation effort and maybe it is even better to always require users to pick the starting point consciously. In any case, this PR is a nice improvement.

Comment on lines +190 to +193
errmsg <- paste0(errmsg,
'Calibration requires a start point, so copy the gdx file with the closest configuration and paste it to:\n ')
}
stop(errmsg, gdx_name, '\n\n')
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a tiny modification which makes ist a bit easier to read, to my taste.

Suggested change
errmsg <- paste0(errmsg,
'Calibration requires a start point, so copy the gdx file with the closest configuration and paste it to:\n ')
}
stop(errmsg, gdx_name, '\n\n')
errmsg <- paste0(errmsg,
'Calibration requires a start point, so copy the gdx file with the closest configuration and paste it to:\n ',
gdx_name, '\n\n')
}
stop(errmsg)

Copy link
Contributor Author

@lecfab lecfab Jan 6, 2026

Choose a reason for hiding this comment

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

I agree it's more readable, but in that case the "gdx_name" would only display if cfg$gms$CES_parameters == 'calibrate' (not sure, but I guess there are other cases)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was always wondering if REMIND shouldn't be able to also copy the file automatically if the users hasn't done that and just throw a warning that - say default SSP2 - has been used as a starting point for the missing calibration scenario.

Completely agreed! once ye told me which files to copy where, it felt pretty mechanical, but cumbersome, to do it every time. I personally don't know enough about calibration and gdx's to discuss it further. @dklein-pik do you think that's a topic that could be brought to RSE decision?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I will put it on our list, but with low priority, if you agree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

of course, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree it's more readable, but in that case the "gdx_name" would only display if cfg$gms$CES_parameters == 'calibrate' (not sure, but I guess there are other cases)

Ah, right. No, the error message should contain the path also if non-calibration runs. So Either disregard my suggestion or add an extra line to keep the current behaviour.

Copy link
Contributor

@dklein-pik dklein-pik left a comment

Choose a reason for hiding this comment

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

Thank you!

@lecfab lecfab merged commit 09137b3 into remindmodel:develop Jan 6, 2026
2 checks passed
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