Parse Mayer bond orders from ESS log files - #951
Open
kfir4444 wants to merge 1 commit into
Open
Conversation
This was referenced Aug 10, 2026
calvinp0
force-pushed
the
mayer_bond_orders_parser
branch
from
August 10, 2026 09:08
50f615b to
3e0e0c0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #951 +/- ##
==========================================
+ Coverage 63.56% 63.57% +0.01%
==========================================
Files 114 114
Lines 38375 38443 +68
Branches 10031 10052 +21
==========================================
+ Hits 24394 24442 +48
- Misses 11063 11077 +14
- Partials 2918 2924 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What
Adds
parse_bond_orders(), returning the Mayer bond order matrix from a Gaussian or Orca log file.Why
ARC infers connectivity from interatomic distances alone —
get_bonds_from_dmat()(arc/common.py), covalent radii scaled by 1.2. That heuristic is least reliable exactly where it matters most: IRC endpoints, loose pre-reactive complexes, and stretched or partially formed bonds, where a distance cutoff either fuses two fragments or splits one.The electronic structure calculation already reports a density-derived bond index. Nothing in ARC read it until now — a repo-wide grep for
mayer|wiberg|nbofinds onlyNBO TRUEwritten for Q-Chemorbitalsjobs, whose output is never parsed back.How
ESSAdapter.parse_bond_orders()is concrete and returnsNone, followingparse_opt_steps/parse_ess_version. Making it@abstractmethodwould have forced all nine adapters to implement it; this way the other seven are untouched.Atomic Valencies and Mayer Atomic Bond Orders:, printed in Fortran-style six-column blocks. The last such section in the file is used, which matters for multi-step jobs. The result is symmetrized to absorb print precision.ATOM NA ZA QA VA BVA FAtable gives the atom count and the diagonal, then the sparse pair listB( 0-O , 1-C ) : 1.0172(already 0-indexed). Orca only prints pairs above 0.1 by default, so weaker interactions come back as exactly 0 — stated in the docstring, since it bounds how low a threshold is meaningful downstream.Return value: a symmetric N×N
np.ndarrayin the log file's atom order, with the diagonal holding the Mayer atomic valence. Gaussian's diagonal and Orca'sVAcolumn are the same quantity, so the two adapters return the same thing.Test data
arc/testing/bond_orders/gains one Gaussian and one Orca log. The test additionally covers three Orca logs already in the repo — a TS with two partial bonds, and a formaldehyde opt with a 2.14 C=O — and assertsNonefor logs with no Mayer section.Testing
pytest arc/parser/— 33 passed.🤖 Generated with Claude Code
Stack (merge bottom-up; ARC uses merge commits, so GitHub retargets each PR as the one below it lands):
mol_from_dft()