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

don't let cs2 fail if outputdirs are not unique #1388

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

orichters
Copy link
Contributor

Purpose of this PR

If you accidentally pass an output directory multiple times to cs2, then it fails to find the correct files and fails, because lucode2::getScenNames() returns the scenario name only once, leading with

outputDirs <- ../remind-2023-06-12/output/C_h_cpol-rem-6, ../remind-2023-06-12/output/C_h_cpol-rem-6, 
output/C_h_cpol_d50-rem-5, output/C_h_cpol_d95high-rem-15

to this error:

Error in `normalizePath()`:
! path[2]="../remind-2023-06-12/output/C_h_cpol-rem-6/REMIND_generic_C_h_cpol_d50-rem-5.mif": No such file or directory

After normalizing the path, unique is applied, avoiding the problem.

Type of change

  • Bug fix

Checklist:

  • My code follows the coding etiquette
  • I performed a self-review of my own code
  • I explained my changes within the PR, particularly in hard-to-understand areas
  • I checked that the in-code documentation is up-to-date
  • All automated model tests pass (FAIL 0 in the output of make test)
  • No need for adjusting the changelog CHANGELOG.md

@orichters orichters merged commit 658efef into remindmodel:develop Sep 4, 2023
2 checks passed
@orichters orichters deleted the cs2 branch December 6, 2023 14:07
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.

2 participants