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

Fix AttributeError NoneType has no attribute 'style' #283

Merged
merged 4 commits into from
Aug 4, 2023

Conversation

janosh
Copy link
Member

@janosh janosh commented Aug 4, 2023

When running VASP with INCAR tag kspacing instead of a KPOINTS file and encountering brmix 2 or 3 times. Reported by @esoteric-ephemera in atomate2 r2SCAN workflow.

The next correction check ISYM and no CHGCAR
        h.correct()
        vi = VaspInput.from_directory(".")
>       assert vi["INCAR"]["ISYM"] == 0
E       KeyError: 'ISYM'
@janosh
Copy link
Member Author

janosh commented Aug 4, 2023

@arosen93 Would be great if you could take a quick look if this seems sensible.

@Andrew-S-Rosen
Copy link
Member

@janosh: Thanks for the ping. This seems sensible to me.

Are we certain that we can do if vi["KPOINTS"] is not None? In other words, we don't need to do the safer option of if vi.get("KPOINTS")?

@janosh
Copy link
Member Author

janosh commented Aug 4, 2023

Yeah, looks like the key is always set, just initialized to None is KPOINTS file not found.

But we don't really need if vi["KPOINTS"] is not None, could do if vi["KPOINTS"].

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 90.90% and project coverage change: +0.01% 🎉

Comparison is base (1497cd4) 66.02% compared to head (a4e6cca) 66.04%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #283      +/-   ##
==========================================
+ Coverage   66.02%   66.04%   +0.01%     
==========================================
  Files          51       51              
  Lines        5549     5549              
==========================================
+ Hits         3664     3665       +1     
+ Misses       1885     1884       -1     
Files Changed Coverage Δ
custodian/cli/run_vasp.py 0.00% <ø> (ø)
custodian/vasp/handlers.py 78.89% <90.90%> (-0.08%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@janosh janosh merged commit 7695d4d into master Aug 4, 2023
3 checks passed
@janosh janosh deleted the guard-again-vasp-input-missing-kpoints branch August 4, 2023 02:25
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