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

Fixes non parsing of incar/job metainformation from vasprun #1272

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ligerzero-ai
Copy link
Contributor

Fixes #1226

@ligerzero-ai ligerzero-ai added the format_black reformat the code using the black standard label Dec 26, 2023
@ligerzero-ai ligerzero-ai added the integration Start the notebook integration tests for this PR label Jan 27, 2024
Comment on lines +621 to +626
except Exception as exc:
if name == "RANDOM_SEED":
# Handles the case where RANDOM SEED > 99999, which results in *****
params[name] = None
else:
raise exc
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Comment on lines +596 to +597
# val = self._parse_from_incar(filename, param_name)
va
Copy link
Contributor

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?

Copy link
Contributor

@pmrv pmrv left a 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.

@jan-janssen jan-janssen marked this pull request as draft February 14, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format_black reformat the code using the black standard integration Start the notebook integration tests for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vasprun parser doesn't parse everything that is intended
3 participants