-
Notifications
You must be signed in to change notification settings - Fork 129
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
Multiple fixes and improvements on MAGICC for damages #1736
Conversation
@@ -18,8 +18,8 @@ | |||
|
|||
# TONN REMOVE start | |||
# If these are already set, it shouldn't override it. We actually may not want to have a default but just throw an error if not set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the code in the following lines actually overwrites the environment variables MAGICC_EXECUTABLE_7
& MAGICC_WORKER_ROOT_DIR
. If you want to achieve the behavior described in this comment, change it to
class EnvironmentError(Exception):
pass
for env_var in ["MAGICC_EXECUTABLE_7", "MAGICC_WORKER_ROOT_DIR"]:
if os.environ.get(env_var, '') == '':
# If clause covers both cases in which the env var is not set at all
# as well as the case in which it is set to an empty string
raise EnvironmentError(f"{env_var} does not exist")
# Optional debug prints
print(f"Found '{env_var}' = '{os.environ.get(env_var)}' ")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem with adding this, under the assumption that it recovers from the infeasibility in the next iteration. The SCC for the region with the infeasibility would not be calculated properly so I don't know exactly what happens then with the further calculation.
Test runs are still in progress, but I don't see a reason for them not to work. I won't have a chance to check this until late in the day on Monday, so if someone needs this on Monday morning just check if this one here worked and if so feel free to merge:
|
Purpose of this PR
Fixes some file paths in the climate_assessment python file to be more generic. We still want it to work outside the cluster @tonnrueter , but that will need some improvements in the interfacing. This change here is better than what we currently have.
Also @fpiontek , you proposed the quickfix with the epsilon value a while ago, but it really doesn't work without it. Should we merge this and make it semi-permanent for now? I found myself always having to stash and reapply this line when I change branches, which feels like a bad sign
Furthermore, this PR makes the standard, between-iteration MAGICC for non-internalized damages use the same Python script used for the TIRF. This allows us a lot more flexibility, and now all MAGICC-related GDXs have yearly data at least until 2200.
@fpiontek this leaves the matter of what emissions to assume after 2150. Right now it's basically assuming all emissions stop after that, but we can also assume them constant with 2150 or 2100 values. It probably won't make much of a difference given the discounting, but we should have a sensible assumption here anyway.
Type of change
(Make sure to delete from the Type-of-change list the items not relevant to your PR)
Checklist:
remind2
where it was neededforbiddenColumnNames
in readCheckScenarioConfig.R in case the PR leads to deprecated switchesFAIL 0
in the output ofmake test
)CHANGELOG.md
has been updated correctlyFurther information (optional):