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

Add support for vaspout.h5, improvements to potcar handling #3680

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
700d255
First pass add functional Vaspout parser
esoteric-ephemera Mar 9, 2024
6231f44
Merge branch 'materialsproject:master' into vaspout
esoteric-ephemera Mar 20, 2024
dbea9d8
Add POTCAR spec attrs to standardize spec, add from_spec method to Po…
esoteric-ephemera Mar 21, 2024
31ba296
pre-commit auto-fixes
pre-commit-ci[bot] Mar 21, 2024
4b792ff
fix failing lobster tests
esoteric-ephemera Mar 21, 2024
c1fde3c
pre-commit auto-fixes
pre-commit-ci[bot] Mar 21, 2024
eef3ee3
Merge branch 'master' into vaspout
esoteric-ephemera Mar 22, 2024
99dfb9a
pre-commit auto-fixes
pre-commit-ci[bot] Mar 22, 2024
e107740
Add Vaspout tests, fix method
esoteric-ephemera Mar 22, 2024
6a60d61
pre-commit and fix test names
esoteric-ephemera Mar 22, 2024
2cc49ed
fix remaining linting and mypy errors
esoteric-ephemera Mar 22, 2024
4261948
Merge branch 'master' into vaspout
esoteric-ephemera Apr 11, 2024
d6a616b
pre-commit auto-fixes
pre-commit-ci[bot] Apr 11, 2024
c3d29d5
Fix python 3.9 support, add charge and magnetization site_properties …
esoteric-ephemera Apr 11, 2024
5a0c985
pre-commit auto-fixes
pre-commit-ci[bot] Apr 11, 2024
dd4fceb
Fix projected DOS parsing
esoteric-ephemera Apr 11, 2024
bd6792a
linting / typing
esoteric-ephemera Apr 11, 2024
aa7c013
remove dunder methods from potcar spec
esoteric-ephemera Apr 11, 2024
68ee0ff
resolve merge conflicts
esoteric-ephemera Apr 26, 2024
ee05396
linting
esoteric-ephemera Apr 26, 2024
0bafff1
increase support for auto k point generation
esoteric-ephemera Apr 26, 2024
b6427a6
linting
esoteric-ephemera Apr 26, 2024
c9475a6
resolve merge conflicts
esoteric-ephemera Jul 25, 2024
1db644d
precommit
esoteric-ephemera Jul 25, 2024
b68ae9c
add h5py to ci extra install for testing
esoteric-ephemera Jul 25, 2024
747a950
make vaspout tests optional
esoteric-ephemera Jul 25, 2024
9dac8ca
explicit reason pass to pytest skipif
esoteric-ephemera Jul 26, 2024
cb5ad84
Merge branch 'master' into vaspout
esoteric-ephemera Jul 31, 2024
ccb57c1
Merge branch 'master' into vaspout
esoteric-ephemera Aug 21, 2024
4cb802b
remove os system call
esoteric-ephemera Aug 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix remaining linting and mypy errors
  • Loading branch information
esoteric-ephemera committed Mar 22, 2024
commit 2cc49ed5da5559a16b06efc5e83bf61e8b2542d5
12 changes: 7 additions & 5 deletions pymatgen/io/vasp/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5539,7 +5539,9 @@ def final_energy(self):
"""Final energy from vaspout."""
return self.ionic_steps[-1]["e_0_energy"]

def remove_potcar_and_write_file(self, filename: str | None = None, fake_potcar_str: str | None = None) -> None:
def remove_potcar_and_write_file(
self, filename: str | Path | None = None, fake_potcar_str: str | None = None
) -> None:
"""
Utility function to replace the full POTCAR with its spec, and write a vaspout.h5.

Expand All @@ -5548,7 +5550,7 @@ def remove_potcar_and_write_file(self, filename: str | None = None, fake_potcar_
to replace it here with just the spec.

Args:
filename : str or None (default)
filename : str, Path, or None (default)
Name of the output file. If None, defaults to self.filename (in-place modification).
fake_potcar_str : str or None (default)
If a str, a POTCAR represented as a str. Used in the context of tests to replace
Expand Down Expand Up @@ -5577,10 +5579,10 @@ def recursive_to_dataset(h5_obj, level, obj):
h5_obj.create_dataset(level, data=data)

filename = filename or self.filename
fname_prefix, fname_ext = os.path.splitext(filename)
fname_prefix, fname_ext = os.path.splitext(filename) # type: ignore[type-var]

# determine if output file is to be compressed
fname_ext = fname_ext.upper()
fname_ext = fname_ext.upper() # type: ignore[union-attr]
compressor = None
if fname_ext == ".BZ2":
compressor = "bzip"
Expand Down Expand Up @@ -5608,7 +5610,7 @@ def recursive_to_dataset(h5_obj, level, obj):

# now compress the file
if compressor:
if os.path.isfile(filename):
if os.path.isfile(filename): # type: ignore[arg-type]
warnings.warn(f"File {filename} already exists, skipping compression.")
else:
os.system(f"{compressor} {fname_prefix}")
Loading