ReactionMechanismGenerator / ReactionMechanismGenerator/ARC
Linear adapter returns no guess for one requested atom map, and reports success anyway
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 51
- Forks
- 25
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 15
Description
Describe the bug
Follow-up to #1042. On the branch that addresses it (linear_adapter_explicit_atom_map, PR #1044) an explicit atom_map is honored and different maps now give different geometries — but for one reaction a requested map returns no guess at all, and the adapter reports success regardless, simply returning fewer guesses than maps requested.
Measured on main @ 4d67ad4c with that branch merged, requesting one guess per distinct correspondence:
| reaction | distinct maps | guesses returned | identical pairs |
|---|---|---|---|
CC[CH]C -> CCC[CH2] |
6 | 6 | 0 |
CC[CH]CC -> CCCC[CH2] |
6 | 6 | 0 |
CCC[CH2] -> CC[CH]C |
4 | 4 | 0 |
[CH2]CC -> C[CH]C |
2 | 2 | 0 |
[CH2]C(C)CC -> CC(C)[CH]C |
2 | 1 | 0 |
The last row is the problem. The two maps differ only in which of the two hydrogens on one carbon migrates, so they are about as similar as two paths of one reaction can be, yet one produces nothing. The failing one is the map closest to the identity:
map A = [2, 1, 0, 3, 4, 9, 11, 8, ...] guess produced
map B = [0, 1, 2, 3, 4, 5, 6, 8, ...] no guess
interpolate_isomerization raises for every weight on that path. The exception is caught, so nothing surfaces to the caller:
File "arc/job/adapters/ts/linear.py", line 1059, in execute_incore
xyzs = interpolate(rxn=rxn, weight=w, existing_xyzs=all_xyzs_so_far,
map_cache=map_cache, forced_atom_map=forced_atom_map)
File "arc/job/adapters/ts/linear.py", line 1813, in interpolate
return interpolate_isomerization(...)
How to reproduce
Request a guess per distinct atom map for [CH2]C(C)CC -> CC(C)[CH]C (intra_H_migration), enumerating the maps first and passing each one to the adapter as atom_map. One of the two comes back empty.
Expected behavior
- When a map is supplied explicitly and no guess survives for it, report that distinctly. An explicitly requested map returning nothing is a different situation from a derived map that happened not to work, and a caller iterating over maps cannot currently tell them apart without counting the results.
- Worth checking whether near-identity maps are the trigger. The same map failed before that branch existed, when I forced it by monkeypatching
map_rxn, so it looks like a property of the interpolation rather than of the new argument.
This is not a regression — the branch is a clear improvement on the previous behavior, where every requested map returned the same geometry. Filing it separately so it is not lost when that PR merges.
Installation information
- ARC
main@4d67ad4cwithlinear_adapter_explicit_atom_mapmerged - Python 3.14, Linux
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in arc/job/adapters/ts/linear.py, especially execute_incore around line 1059 and interpolate around line 1813, then trace the interpolate_isomerization path. Reproduce the explicit-map case for [CH2]C(C)CC -> CC(C)[CH]C and inspect how its exceptions and empty results are handled. Done means an explicitly requested map that yields no guess is reported distinctly from a derived map, with the existing successful cases preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100