Conversation
There was a problem hiding this comment.
Pull request overview
Refactors Arkane QM energy-correction lookup so Atom Energy Corrections (AEC) and Bond Additivity Corrections (BAC) are resolved independently, improving robustness when only one correction type is available or when their best-matching RMG database keys differ.
Changes:
- Added AEC-only validation path (
check_arkane_aec) and improved messaging in BAC validation (check_arkane_bacs). - Updated
get_qm_corrections.pyandarc.output._get_energy_correctionsto pass/handle separateaec_keyandbac_key. - Added unit tests covering independent key resolution and logging/validation behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| arc/statmech/arkane.py | Adds AEC-only check and refines BAC/AEC validation logging. |
| arc/statmech/arkane_test.py | Adds tests for new AEC/BAC matching and log behavior. |
| arc/scripts/get_qm_corrections.py | Accepts separate AEC/BAC keys for correction extraction. |
| arc/output.py | Resolves AEC/BAC keys independently before calling the extraction script. |
| arc/output_test.py | Tests that AEC/BAC keys are resolved and passed independently. |
| arc/main.py | Ensures AEC availability is validated even when BAC is disabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #858 +/- ##
==========================================
+ Coverage 60.09% 60.13% +0.04%
==========================================
Files 102 102
Lines 31009 31043 +34
Branches 8074 8082 +8
==========================================
+ Hits 18636 18669 +33
- Misses 10065 10067 +2
+ Partials 2308 2307 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Updated Arkane validation logic to provide more granular feedback when atom energy corrections (AEC) or bond additivity corrections (BAC) are missing. Key changes include: - Added `check_arkane_aec` to verify atom energy corrections independently when BAC is disabled. - Enhanced `check_arkane_bacs` to specifically identify and log whether AEC, BAC, or both are missing from the RMG database. - Improved log reporting to distinguish between PBAC and MBAC types. Enhance Arkane AEC and BAC validation logging and error handling Updated the validation logic for Arkane energy corrections to handle potential input errors and provide more granular feedback when entries are missing. Key changes include: - Added exception handling to catch cases where Arkane quantum corrections data cannot be loaded from the RMG database. - Improved logging to specifically identify the matched BAC key and correction type (PBAC or MBAC). - Added a general warning message when no matching Arkane entry is found for a given level of theory.
Updated the energy correction retrieval logic to perform independent fuzzy matching for AEC and BAC keys. This ensures corrections can be retrieved even if they are stored under slightly different level-of-theory definitions in the RMG database (e.g., one including the software attribute and the other not). Key changes include: - Added specific search ranges for PBAC and MBAC sections within the database files. - Updated the `get_qm_corrections.py` script interface to handle separate keys for atom and bond corrections. - Remove unused import "get_arkane_model_chemistry"
Updated the logic for determining the Arkane level of theory to provide logging regarding its source and integrated AEC validation when BAC is not used. Key changes include: - Added logging to identify if the Arkane level of theory was explicitly set or inferred from the composite method or single point level. - Integrated a call to `check_arkane_aec` to verify atom energy corrections when `bac_type` is not specified.
Updated the logic for retrieving QM corrections to handle separate keys for atom energy corrections (AEC) and bond additivity corrections (BAC). This ensures that corrections can be resolved independently if they are stored under different level-of-theory definitions in the RMG database. Key changes include: - Updated the script to process `aec_key` and `bac_key` independently. - Maintained backward compatibility by using `matched_key` as a fallback for `aec_key`. - Modified BAC retrieval to utilize the dedicated `bac_key`. Support backward compatibility for BAC keys in the QM corrections script Updated the logic for retrieving QM corrections to handle legacy input formats where atom and bond corrections are not defined as independent keys. Key changes include: - Maintained backward compatibility by using `matched_key` as a fallback for `bac_key`, mirroring the existing behavior for `aec_key`.
Previously, Arkane's Atom Energy Corrections (AEC) and Bond Additivity Corrections (BAC) relied on a single model chemistry key for lookup in the RMG database. This limited flexibility and could lead to issues if only one type of correction was available or if the optimal database keys for AEC and BAC differed (e.g., differing
softwareattribute requirements).This update refactors the QM correction lookup to resolve AEC and BAC keys independently:
ARCclass now explicitly validates AEC availability even when BAC is not requested. Validation messages are enhanced to clearly distinguish scenarios where AEC, BAC, both, or neither are found, providing more informative feedback.get_qm_corrections.py) has been updated to accept and process separate AEC and BAC keys, ensuring more accurate application of available corrections.These improvements make Arkane thermochemistry calculations more robust and precise by ensuring ARC can correctly identify and apply the most appropriate energy corrections. New unit tests verify the independent key resolution and enhanced validation logic.