Skip to content

Commit

Permalink
fix issues proposed by Christina
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Jun 3, 2024
1 parent e3a949f commit 80749ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions pymatgen/io/lobster/inputs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Module for reading Lobster input files.
"""Module for reading LOBSTER input files.
For more information on LOBSTER see www.cohp.de.
If you use this module, please cite:
Expand Down Expand Up @@ -55,11 +55,11 @@

class Lobsterin(UserDict, MSONable):
"""Handle and generate lobsterin files.
Furthermore, it can also modify INCAR files for LOBSTER, generate KPOINTS files for fatband calculations in Lobster,
Furthermore, it can also modify INCAR files for LOBSTER, generate KPOINTS files for fatband calculations in LOBSTER,
and generate the standard primitive cells in a POSCAR file that are needed for the fatband calculations.
There are also several standard lobsterin files that can be easily generated.
Reminder: LOBSTER is not case sensitive.
Reminder: LOBSTER input keywords are not case sensitive.
"""

# Keyword + float
Expand Down Expand Up @@ -147,8 +147,9 @@ def __init__(self, settingsdict: dict) -> None:

def __setitem__(self, key: str, val: Any) -> None:
"""
Necessary due to the missing case sensitivity of LOBSTER.
Also clean the keys and values by stripping white spaces.
Necessary due to the missing case sensitivity of input
keywords of LOBSTER. Also clean the keys and values by
stripping white spaces.
Raises:
KeyError: if keyword is not available.
Expand Down Expand Up @@ -335,7 +336,7 @@ def get_basis(
potcar_symbols: list[str],
address_basis_file: PathLike | None = None,
) -> list[str]:
"""Get the basis from given potcar_symbols, e.g., ["Fe_pv", "Si"].
"""Get the basis functions from given potcar_symbols, e.g., ["Fe_pv", "Si"].
Args:
structure (Structure): Structure object
Expand Down Expand Up @@ -649,7 +650,7 @@ def standard_calculations_from_vasp_files(
dict_for_basis: dict | None = None,
option: str = "standard",
) -> Self:
"""Generate Lobsterin with standard settings.
"""Generate lobsterin with standard settings.
Args:
POSCAR_input (PathLike): path to POSCAR
Expand Down Expand Up @@ -695,7 +696,7 @@ def standard_calculations_from_vasp_files(
raise ValueError("The option is not valid!")

lobsterin_dict: dict[str, Any] = {
# This basis set covers most elements
# This basis set covers elements up to Lr (Z = 103)
"basisSet": "pbeVaspFit2015",
# Energies around e-fermi
"COHPstartEnergy": -35.0,
Expand Down Expand Up @@ -816,7 +817,7 @@ def standard_calculations_from_vasp_files(
# Will just insert this basis and not check with poscar
basis = [f"{key} {value}" for key, value in dict_for_basis.items()]
elif POTCAR_input is not None:
# Get basis from POTCAR
# Get basis functions from POTCAR
potcar_names = cls._get_potcar_symbols(POTCAR_input=POTCAR_input)

basis = cls.get_basis(structure=Structure.from_file(POSCAR_input), potcar_symbols=potcar_names)
Expand Down
2 changes: 1 addition & 1 deletion tests/io/lobster/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ def setUp(self):
self.Lobsterin4 = Lobsterin.from_file(f"{TEST_DIR}/lobsterin.4.gz")

def test_from_file(self):
# Test read from file
# Test reading from file
assert self.Lobsterin["cohpstartenergy"] == approx(-15.0)
assert self.Lobsterin["cohpendenergy"] == approx(5.0)
assert self.Lobsterin["basisset"] == "pbeVaspFit2015"
Expand Down

0 comments on commit 80749ff

Please sign in to comment.