Repository navigation
Suspected Typo Fix in pymatgen.io.vasp.optics - #2989
Merged
Merged
Conversation
Member
|
Thanks for the fix! 👍 This sounds sensible. We should definitely have tests for these functions. |
janosh
enabled auto-merge (squash)
May 14, 2023 14:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.opticsmodule, it's been very very useful! 🙌This is just a small fix for a suspected typo in handling
ismearin thedelta_func()andstep_func()functions.ISMEARis 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 = 0ends up returning the Methfessel-Paxton smearing (delta_methfessel_paxton), however the function underif ismear < 0is the Gaussian smearing.ismearshould be an integer anyway, so havingismear < -1raise an error andismear == -1return something else, it means that theismear < 0line 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.