BugFix: use str(freq_level) to get frequency scale factor from dict#1966
Closed
oscarwumit wants to merge 1 commit into
Closed
BugFix: use str(freq_level) to get frequency scale factor from dict#1966oscarwumit wants to merge 1 commit into
oscarwumit wants to merge 1 commit into
Conversation
The keys of data.freq_dict are strings, but freq_level is an object. This mismatch results in KeyError.
|
The keys in |
Contributor
Author
|
Thanks, @cgrambow. When I did the test, I forgot to |
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.
Motivation or Problem
The keys of data.freq_dict are strings, but freq_level is an object. This mismatch results in KeyError, and subsequently gave a wrong frequency scale factor of 1 for model chemistries exist in the database.
This bug also caused ARC to crash as it incorrectly informs ARC about the frequency scale factor. Related to ReactionMechanismGenerator/ARC#398
Execute the following in a Jupiter notebook will reveal the bug:
from arkane.encorr.corr import assign_frequency_scale_factor
from arkane.modelchem import LevelOfTheory
import arkane.encorr.data as data
lot = LevelOfTheory(method='b3lyp',basis='6311+g(3df,2p)',software='gaussian')
assign_frequency_scale_factor(lot)
Output: WARNING:root:No frequency scaling factor found for LevelOfTheory(method='b3lyp',basis='6311+g(3df,2p)',software='gaussian'). Assuming a value of unity. This will affect the partition function and all quantities derived from it (thermo quantities and rate coefficients).
Description of Changes
Convert freq_level to string before using it as a key.
Testing
After the change, repeat the above example code in the Jupiter notebook gave the correct frequency scale factor of 0.967.