Skip to content

Commit

Permalink
Didn't really fix the ibrav check
Browse files Browse the repository at this point in the history
  • Loading branch information
ebanyas committed Aug 20, 2024
1 parent 05bb85c commit 49fa739
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions pymatgen/io/espresso/caffeinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def caffeinate(vasp_in, **kwargs):
if isinstance(vasp_in, Kpoints):
return _caffeinate_kpoints(vasp_in)
elif isinstance(vasp_in, Poscar):
return _caffeinate_poscar(vasp_in, **kwargs)
return _caffeinate_poscar(vasp_in,
ibrav = kwargs.get("ibrav", False)
)
else:
raise CaffeinationError(
"Input file type not recognized (or not yet supported)"
Expand Down Expand Up @@ -197,11 +199,19 @@ def _caffeinate_poscar(poscar, **kwargs):
"""

#TODO: clean this up
ibrav = kwargs.get("ibrav", False)
if ibrav not in [True, "True", "true", "T", "t"]:
# this is even more convoluted than before
if ibrav in [False, "False", "false", "F", "f"]:
ibrav = False
else:
elif ibrav in [True, "True", "true", "T", "t"]:
ibrav = True
else:
warnings.warn(
(
"Warning: keyword 'ibrav' is not parsable as a boolean! "
"The ibrav setting will not be used (i.e. 'ibrav = 0').",
CaffeinationWarning)
)
ibrav = False

struct = poscar.structure

Expand Down

0 comments on commit 49fa739

Please sign in to comment.