Let the Linear TS adapter generate guesses for requested atom maps - #1044
Open
kfir4444 wants to merge 2 commits into
Open
Let the Linear TS adapter generate guesses for requested atom maps#1044kfir4444 wants to merge 2 commits into
kfir4444 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1044 +/- ##
=======================================
Coverage 65.55% 65.56%
=======================================
Files 121 121
Lines 41073 41121 +48
Branches 10566 10579 +13
=======================================
+ Hits 26927 26959 +32
- Misses 11117 11126 +9
- Partials 3029 3036 +7
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:
|
calvinp0
force-pushed
the
linear_adapter_explicit_atom_map
branch
from
September 8, 2026 09:21
10e4352 to
d545be9
Compare
calvinp0
reviewed
Sep 8, 2026
| if uni_is_product: | ||
| try: | ||
| atom_map = cached_map_rxn(rxn=rxn, product_dict_index=i, map_cache=map_cache) | ||
| atom_map = cached_map_rxn(rxn=rxn, product_dict_index=i, map_cache=map_cache, |
Member
There was a problem hiding this comment.
the requested atom map can still be ignored in some cases. when a molecule splits into fragments, parts of the code still choose their own atom correspondence. so you ask for map a, and you may instead receive another map, reported as successful
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.
Summary
LinearAdapterderives an atom map per reaction path viamap_rxnand never reads a map set on the reaction, so pre-setting one changed nothing and was not reported. This addsLinearAdapter(atom_map=...), taking one map or several: each requested map replaces the derived one for a full pass over the weight grid, so a TS guess can be requested for a specific reactants-to-products correspondence. Requested maps are validated (permutation, atom count, element-preserving) and unusable ones are reported rather than silently dropped. A pre-setrxn.atom_mapstill does not take part in the derivation - other adapters populate it as a side effect of reading it - but the adapter now warns that it is unused and points at the new argument, and the docstrings say guesses are generated per product dictionary.Closes #1042