Repository navigation
Add sort_reactants option to ReactionEnumerator - #7
Open
mattball30 wants to merge 3 commits into
Open
mattball30 wants to merge 3 commits into
mattball30 wants to merge 3 commits into
Conversation
Lets callers keep the input order of reactants in results instead of sorting them, so a deterministic reactant order can be passed through. Defaults to True, so existing behaviour is unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Adds a
sort_reactantsargument (defaultTrue) toReactionEnumerator. Currentlyreactant_aandreactant_bof eachReactionResultare always the two input SMILES in sorted order. Withsort_reactants=False, they keep the order of the input pair, so a caller can supply reactants in a deterministic order.Changes
sort_reactantsis accepted byenumerate_pair,products_for_pair,enumerate_pairsandenumerate_pairs_lazy._enumerate_pair_from_mols,_enumerate_pair_from_keys,_process_chunkand the parallel worker functions (_worker_run_pair,_worker_run_pairs_batch), so serial and parallel runs behave the same.enumerate_pair,enumerate_pairs(serial and parallel) andenumerate_pairs_lazy. Thesubmitspy in an existing test now forwards the extra argument.[Unreleased], and anAUTHORS.mdupdate.Compatibility
The default is
True, so existing behaviour is unchanged. Products and template order are not affected by this option.Testing
The full test suite passes (155 tests).