Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fxi UnboundLocalError: local variable 'e_electronic_with_corrections' referenced before assignment #2756

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

alongd
Copy link
Member

@alongd alongd commented Feb 3, 2025

Motivation or Problem

Arkane's statmech.py has a variable defined within an if statement, but used outside of it. When the statement evaluates to False, Arkane crushes.

Description of Changes

Defined e_electronic_with_corrections and zpe formally outside the if statement, and properly deal with e0 assignment after the condition.

Testing

An Arkane example for feeding in E0 directly for a species was added
(Arkane's examples are automatically executed as functional tests)

@sevyharris sevyharris self-requested a review February 3, 2025 13:24

energy = (-342.84,'kJ/mol')

geometry = Log('OCHO/freq.out')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
geometry = Log('OCHO/freq.out')
geometry = Log('freq.out')


geometry = Log('OCHO/freq.out')

frequencies = Log('OCHO/freq.out')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
frequencies = Log('OCHO/freq.out')
frequencies = Log('freq.out')

@sevyharris
Copy link
Contributor

Thanks for this PR! I think the path is off for the Gaussian frequencies log, but otherwise it looks good to me. Hopefully fixing the path will also get it to pass all the continuous integration tests, and then it should be ready to merge.

@alongd alongd force-pushed the arkane_e_elect_bug branch from aa6922f to 7090358 Compare February 8, 2025 16:50
@alongd
Copy link
Member Author

alongd commented Feb 8, 2025

Thanks for the catch, @sevyharris! I updated the path now

Copy link

github-actions bot commented Feb 8, 2025

Regression Testing Results

WARNING:root:Initial mole fractions do not sum to one; normalizing.
WARNING:root:Initial mole fractions do not sum to one; normalizing.
WARNING:root:Initial mole fractions do not sum to one; normalizing.
⚠️ One or more regression tests failed.
Please download the failed results and run the tests locally or check the log to see why.

Detailed regression test results.

Regression test aromatics:

Reference: Execution time (DD:HH:MM:SS): 00:00:01:06
Current: Execution time (DD:HH:MM:SS): 00:00:01:08
Reference: Memory used: 2772.71 MB
Current: Memory used: 2781.76 MB

aromatics Passed Core Comparison ✅

Original model has 15 species.
Test model has 15 species. ✅
Original model has 11 reactions.
Test model has 11 reactions. ✅

aromatics Passed Edge Comparison ✅

Original model has 106 species.
Test model has 106 species. ✅
Original model has 358 reactions.
Test model has 358 reactions. ✅

Observables Test Case: Aromatics Comparison

✅ All Observables varied by less than 0.500 on average between old model and new model in all conditions!

aromatics Passed Observable Testing ✅

Regression test liquid_oxidation:

Reference: Execution time (DD:HH:MM:SS): 00:00:02:18
Current: Execution time (DD:HH:MM:SS): 00:00:02:23
Reference: Memory used: 2896.28 MB
Current: Memory used: 2895.94 MB

liquid_oxidation Passed Core Comparison ✅

Original model has 37 species.
Test model has 37 species. ✅
Original model has 241 reactions.
Test model has 241 reactions. ✅

liquid_oxidation Failed Edge Comparison ❌

Original model has 214 species.
Test model has 214 species. ✅
Original model has 1590 reactions.
Test model has 1590 reactions. ✅
The original model has 2 reactions that the tested model does not have. ❌
rxn: CC(C[CH]COO)OO(118) <=> CC(CC[CH]OO)OO(133) origin: intra_H_migration
rxn: CC(C[CH]COO)OO(118) <=> C[C](CCCOO)OO(132) origin: intra_H_migration
The tested model has 2 reactions that the original model does not have. ❌
rxn: CC(C[CH]COO)OO(115) <=> [OH](22) + CC(CCC=O)OO(116) origin: intra_H_migration
rxn: CC(C[CH]COO)OO(115) <=> [OH](22) + CC(=O)CCCOO(112) origin: intra_H_migration

Observables Test Case: liquid_oxidation Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

liquid_oxidation Passed Observable Testing ✅

Regression test nitrogen:

Reference: Execution time (DD:HH:MM:SS): 00:00:01:25
Current: Execution time (DD:HH:MM:SS): 00:00:01:27
Reference: Memory used: 2892.65 MB
Current: Memory used: 2897.29 MB

nitrogen Passed Core Comparison ✅

Original model has 41 species.
Test model has 41 species. ✅
Original model has 360 reactions.
Test model has 360 reactions. ✅

nitrogen Passed Edge Comparison ✅

Original model has 133 species.
Test model has 133 species. ✅
Original model has 983 reactions.
Test model has 983 reactions. ✅

Observables Test Case: NC Comparison

✅ All Observables varied by less than 0.200 on average between old model and new model in all conditions!

nitrogen Passed Observable Testing ✅

Regression test oxidation:

Reference: Execution time (DD:HH:MM:SS): 00:00:02:23
Current: Execution time (DD:HH:MM:SS): 00:00:02:30
Reference: Memory used: 2761.67 MB
Current: Memory used: 2757.94 MB

oxidation Passed Core Comparison ✅

Original model has 59 species.
Test model has 59 species. ✅
Original model has 694 reactions.
Test model has 694 reactions. ✅

oxidation Passed Edge Comparison ✅

Original model has 230 species.
Test model has 230 species. ✅
Original model has 1526 reactions.
Test model has 1526 reactions. ✅

Observables Test Case: Oxidation Comparison

✅ All Observables varied by less than 0.500 on average between old model and new model in all conditions!

oxidation Passed Observable Testing ✅

Regression test sulfur:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:55
Current: Execution time (DD:HH:MM:SS): 00:00:00:55
Reference: Memory used: 2864.66 MB
Current: Memory used: 2879.06 MB

sulfur Passed Core Comparison ✅

Original model has 27 species.
Test model has 27 species. ✅
Original model has 74 reactions.
Test model has 74 reactions. ✅

sulfur Failed Edge Comparison ❌

Original model has 89 species.
Test model has 89 species. ✅
Original model has 227 reactions.
Test model has 227 reactions. ✅
The original model has 1 reactions that the tested model does not have. ❌
rxn: O(4) + SO2(15) (+N2) <=> SO3(16) (+N2) origin: primarySulfurLibrary
The tested model has 1 reactions that the original model does not have. ❌
rxn: O(4) + SO2(15) (+N2) <=> SO3(16) (+N2) origin: primarySulfurLibrary

Observables Test Case: SO2 Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

sulfur Passed Observable Testing ✅

Regression test superminimal:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:35
Current: Execution time (DD:HH:MM:SS): 00:00:00:36
Reference: Memory used: 2947.01 MB
Current: Memory used: 2990.76 MB

superminimal Passed Core Comparison ✅

Original model has 13 species.
Test model has 13 species. ✅
Original model has 21 reactions.
Test model has 21 reactions. ✅

superminimal Passed Edge Comparison ✅

Original model has 18 species.
Test model has 18 species. ✅
Original model has 28 reactions.
Test model has 28 reactions. ✅

Regression test RMS_constantVIdealGasReactor_superminimal:

Reference: Execution time (DD:HH:MM:SS): 00:00:02:21
Current: Execution time (DD:HH:MM:SS): 00:00:02:24
Reference: Memory used: 3484.17 MB
Current: Memory used: 3502.35 MB

RMS_constantVIdealGasReactor_superminimal Passed Core Comparison ✅

Original model has 13 species.
Test model has 13 species. ✅
Original model has 19 reactions.
Test model has 19 reactions. ✅

RMS_constantVIdealGasReactor_superminimal Passed Edge Comparison ✅

Original model has 13 species.
Test model has 13 species. ✅
Original model has 19 reactions.
Test model has 19 reactions. ✅

Observables Test Case: RMS_constantVIdealGasReactor_superminimal Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

RMS_constantVIdealGasReactor_superminimal Passed Observable Testing ✅

Regression test RMS_CSTR_liquid_oxidation:

Reference: Execution time (DD:HH:MM:SS): 00:00:06:06
Current: Execution time (DD:HH:MM:SS): 00:00:06:16
Reference: Memory used: 3470.88 MB
Current: Memory used: 3469.77 MB

RMS_CSTR_liquid_oxidation Passed Core Comparison ✅

Original model has 37 species.
Test model has 37 species. ✅
Original model has 202 reactions.
Test model has 202 reactions. ✅

RMS_CSTR_liquid_oxidation Passed Edge Comparison ✅

Original model has 248 species.
Test model has 248 species. ✅
Original model has 2057 reactions.
Test model has 2057 reactions. ✅

Observables Test Case: RMS_CSTR_liquid_oxidation Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

RMS_CSTR_liquid_oxidation Passed Observable Testing ✅

Regression test fragment:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:41
Current: Execution time (DD:HH:MM:SS): 00:00:00:42
Reference: Memory used: 2692.11 MB
Current: Memory used: 2692.51 MB

fragment Passed Core Comparison ✅

Original model has 10 species.
Test model has 10 species. ✅
Original model has 2 reactions.
Test model has 2 reactions. ✅

fragment Passed Edge Comparison ✅

Original model has 33 species.
Test model has 33 species. ✅
Original model has 47 reactions.
Test model has 47 reactions. ✅

Observables Test Case: fragment Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

fragment Passed Observable Testing ✅

Regression test RMS_constantVIdealGasReactor_fragment:

Reference: Execution time (DD:HH:MM:SS): 00:00:03:02
Current: Execution time (DD:HH:MM:SS): 00:00:03:06
Reference: Memory used: 3629.46 MB
Current: Memory used: 3644.52 MB

RMS_constantVIdealGasReactor_fragment Passed Core Comparison ✅

Original model has 10 species.
Test model has 10 species. ✅
Original model has 2 reactions.
Test model has 2 reactions. ✅

RMS_constantVIdealGasReactor_fragment Passed Edge Comparison ✅

Original model has 27 species.
Test model has 27 species. ✅
Original model has 24 reactions.
Test model has 24 reactions. ✅

Observables Test Case: RMS_constantVIdealGasReactor_fragment Comparison

✅ All Observables varied by less than 0.100 on average between old model and new model in all conditions!

RMS_constantVIdealGasReactor_fragment Passed Observable Testing ✅

Regression test minimal_surface:

Reference: Execution time (DD:HH:MM:SS): 00:00:00:44
Current: Execution time (DD:HH:MM:SS): 00:00:00:45
Reference: Memory used: 2862.62 MB
Current: Memory used: 2875.47 MB

minimal_surface Passed Core Comparison ✅

Original model has 11 species.
Test model has 11 species. ✅
Original model has 3 reactions.
Test model has 3 reactions. ✅

minimal_surface Passed Edge Comparison ✅

Original model has 38 species.
Test model has 38 species. ✅
Original model has 38 reactions.
Test model has 38 reactions. ✅

Observables Test Case: minimal_surface Comparison

✅ All Observables varied by less than 0.500 on average between old model and new model in all conditions!

minimal_surface Passed Observable Testing ✅

beep boop this comment was written by a bot 🤖

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