Suspected Typo Fix in pymatgen.io.vasp.optics
#2989
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
Firstly, thanks to the developers for the recent addition of the
pymatgen.io.vasp.optics
module, it's been very very useful! 🙌This is just a small fix for a suspected typo in handling
ismear
in thedelta_func()
andstep_func()
functions.ISMEAR
is zero for Gaussian smearing, and indeed in the docstrings forget_epsilon()
it states:ismear: Smearing method (only has 0:gaussian, >0:Methfessel-Paxton)
. However, in the current version of the code:ismear = 0
ends up returning the Methfessel-Paxton smearing (delta_methfessel_paxton
), however the function underif ismear < 0
is the Gaussian smearing.ismear
should be an integer anyway, so havingismear < -1
raise an error andismear == -1
return something else, it means that theismear < 0
line is always skipped. This is also the case for thestep_func()
function.I believe this is likely a small typo, and should instead by
if ismear == 0:
. I have changed it to this in this PR, and tests are passing.