Skip to content

BugFix: use str(freq_level) to get frequency scale factor from dict#1966

Closed
oscarwumit wants to merge 1 commit into
masterfrom
bug_fix_freq_scale_check
Closed

BugFix: use str(freq_level) to get frequency scale factor from dict#1966
oscarwumit wants to merge 1 commit into
masterfrom
bug_fix_freq_scale_check

Conversation

@oscarwumit

@oscarwumit oscarwumit commented May 26, 2020

Copy link
Copy Markdown
Contributor

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).

1

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.

The keys of data.freq_dict are strings, but freq_level is an object. This mismatch results in KeyError.
@cgrambow

Copy link
Copy Markdown

The keys in data.freq_dict are not strings. They get converted to level of theory objects when loading arkane.encorr.data. I ran your example and it works fine for me using the level of theory object.

@oscarwumit oscarwumit removed the Priority: Critical Should be addressed ASAP label May 26, 2020
@oscarwumit

Copy link
Copy Markdown
Contributor Author

Thanks, @cgrambow. When I did the test, I forgot to make clean and make. Because RMGobject has been modified, it is important to recompile the code. After recompiling, the code behaves normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants