-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fixes non parsing of incar/job metainformation from vasprun #1272
base: main
Are you sure you want to change the base?
Conversation
except Exception as exc: | ||
if name == "RANDOM_SEED": | ||
# Handles the case where RANDOM SEED > 99999, which results in ***** | ||
params[name] = None | ||
else: | ||
raise exc |
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.
except Exception as exc: | |
if name == "RANDOM_SEED": | |
# Handles the case where RANDOM SEED > 99999, which results in ***** | |
params[name] = None | |
else: | |
raise exc | |
except Exception: | |
if name == "RANDOM_SEED": | |
# Handles the case where RANDOM SEED > 99999, which results in ***** | |
params[name] = None | |
else: | |
raise |
Using raise inside an except block re-raises automatically. Can we also make the exception more specific?
# LDAUL/J as 2**** | ||
val = self._parse_from_incar(filename, param_name) | ||
if val is None: | ||
raise err |
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.
raise err | |
raise err from None |
This will clear up the stacktrace.
It feels a bit strange, to pre define the exception. It works and there's no down side, though.
# val = self._parse_from_incar(filename, param_name) | ||
va |
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.
Feels like there's something missing here?
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.
Thanks for taking this on! Not sure if you are done with this already, but I left some small remarks anyway. I like the escape hatch by reading from INCAR, even though it's not used yet.
Fixes #1226